Skip to content

type hints need to be distributed with cpython/projects, instead of being in a separate repo #3953

@ngie-eign

Description

@ngie-eign

While testing out type hints with mypy dealing with some of the customizations my group made to cpython 3.8.2, I was surprised and shocked that the type hints for stdlib live in a separate repo, instead of being distributed with the base interpreter.

Distributing the .pyi files with the base interpreter and individual projects should be done to reduce friction for end-users that customize cpython and other projects to meet their needs without having to jump through hoops to effectively maintain a duplicate type hints file for underlying implementations that implement the customizations. What will happen over time, I fear, is that the .pyi files will become crufty/incorrect or out of sync with the implementations as functions/constants are added/removed by other developers.

Tying the interface files to the project that they describe makes sense, intuitively and pragmatically and will result in less of a maintenance nightmare.

Please see this mypy issue for more details: python/mypy#8745 .

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