Skip to content

Rename local definitions in stubs (such as T) to use underscores (_T) #452

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

Closed
JukkaL opened this issue Sep 14, 2014 · 0 comments · Fixed by #455
Closed

Rename local definitions in stubs (such as T) to use underscores (_T) #452

JukkaL opened this issue Sep 14, 2014 · 0 comments · Fixed by #455

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 14, 2014

If a stub contains a local definition that should not be exported, it should be named with an underscore prefix so that from x import * does not import the definition.

For example, stubs/3.2/itertools.py defines these type variables:

T = typevar('T')
S = typevar('S')

It should be refactored like this:

_T = typevar('_T')
_S = typevar('_S')

(and all references to T and S should be fixed, of course)

No need to fix all of these in one go; this can be fixed gradually. The most important module is typing, since it would be nice to be able to use from typing import * without namespace pollution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant