You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a stub for module x imports something from typing, for example, currently from x import * also imports that name, which is wrong, since generally the module implementation does not import anything from typing, and besides it's just a bad idea in general.
However, we don't want to define __all__ for every stub, as that would be painful and redundant, since stubs mostly contain only exported features. Maybe we should not export any imported names by default, unless the import uses as. For example:
fromtypingimportList# Not exportedimportos.pathaspath# Exportedimportosasos# Also exported
This would only affect stubs. We need a way of knowing which files are stubs. Initially, just anything that is under stubs/ should be considered a stub.
The text was updated successfully, but these errors were encountered:
Sorry, I disagree here. import os as os is unexpected. __all__ is verbose but at least people expect and understand it (hopefully?). Also, the fact that as was used is unavailable during runtime which might or might not be relevant in the future, for instance when somebody tries to implement runtime checks.
If a stub for module
x
imports something fromtyping
, for example, currentlyfrom x import *
also imports that name, which is wrong, since generally the module implementation does not import anything fromtyping
, and besides it's just a bad idea in general.However, we don't want to define
__all__
for every stub, as that would be painful and redundant, since stubs mostly contain only exported features. Maybe we should not export any imported names by default, unless the import usesas
. For example:This would only affect stubs. We need a way of knowing which files are stubs. Initially, just anything that is under
stubs/
should be considered a stub.The text was updated successfully, but these errors were encountered: