Open henzef opened 2 weeks ago
Only semi-related remark: It would be helpful if stubgen could be configured to only re-export names that are already explicitly re-exported in the source file. This would allow me to workaround this issue and would also fix #2190
it also does this if there is an explicit __all__
Bug Report
mypy stubgen re-exports more names than needed (despite --export-less). It seems that imports that are only used in function parameter type annotations (see FirstErrorType below) are always re-exported and imports from 'if TYPE_CHECKING' clauses (see SecondErrorType below) as well.
To Reproduce
Expected Behavior
Nether FirstErrorType nor SecondErrorType should be re-exported according to the documentation of the --export-less switch, which states
Actual Behavior
the output of
stubgen --export-less example.py
Your Environment
mypy.ini
(and other config files): none