-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
project: policyOrganization of the typeshed projectOrganization of the typeshed project
Description
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:
- Linters and IDEs (as well as the linter in my brain) often mark them as "using a private item from an external module". This isn't really the case here as we support the use of these items during type checking.
- It doesn't really communicate the fact that the item is available during type-check only.
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.
Metadata
Metadata
Assignees
Labels
project: policyOrganization of the typeshed projectOrganization of the typeshed project