make a mypy plugin for doing this checking at type-check time rather than runtime
Opened this issue · 0 comments
glyph commented
For projects that use mypy
, we could make publication
into a mypy plugin that would detect the use of private names and complain about importing them with a specific error, turning publish()
into a complete no-op at runtime. This would make its runtime behavior even less esoteric and provide warnings at the time when developers are most likely to notice them.
We probably still need a runtime version since it's going to be a really long tail until all python projects both publish and consume stubs, though.