Skip to content

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

Closed
@JukkaL

Description

@JukkaL

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions