I’ve encountered a weird issue with
inspect.getmembers() and would like some help.
I’ve been adding type hints to a project. One of my classes is a generic container, so I made a type variable
_T = TypeVar('_T') so I could write
class MyContainer(Deque[_T]) and not export the variable from the module.
There is a test that uses
inspect to make sure only the public API is exported.
For some reason in Python >= 3.7,
_T as one of the exports despite the leading underscore and despite
_T. This is causing the test fail.
A simplified example and results can be seen here:
What changed between 3.6 and 3.7? Am I using