-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Underscore for type-check only items? #11122
Comments
I think we need to make sure we continue to clearly signal "danger" to users with these aliases. Importing things under So: I'm open to changes, but think we need to be cautious and make sure we don't regress on user experience for people who don't know about typeshed etc. :) |
I also think stubtest could help us here for the |
Currently we have _typeshed. What about expanding that? I'd suggest that for a given stdlib module foo we should import from My thinking there is that most stdlib modules are single-file, and it'd be a pain to convert them all to a directory just for this. But on the other hand, putting all the third-party modules under _typeshed.* would be breaking the context more than necessary, and maybe be a little crowded |
Just a random thought: When we add classes or type aliases to stubs that aren't available at runtime, but could be useful for users as well (by using
if TYPE_CHECKING:
), we currently prefix them with an underscore. This has two disadvantages:Maybe it would make sense to come up with another convention to mark these type-check only? The (admittedly failed)
@type_check_only
decorator doesn't really help in this situation, as it marks the items only when defining them, not when importing them. It also doesn't work with type aliases.The text was updated successfully, but these errors were encountered: