Skip to content

Distribute stdlib types as types-stdlib #5835

@srittau

Description

@srittau

This has been briefly discussed before, but I think it would be a good idea if we started distributing the stdlib types in a separate package types-stdlib, similar to third-party packages:

  • Type checkers could optionally depend on (a specific version of) that package, instead of shipping their own copy, reducing coupling and arguably improving maintainability.
  • Third-party stubs could require a minimum version of the types-stdlib package, for example if they are relying on _typeshed features or for cases like Add setuptools stubs #5762. Type checkers that opt to distribute a copy of the stdlib, could warn if incompatible stubs are used.

Technical considerations:

  • The versioning scheme would be similar to third-party stubs, e.g. types-stdlib 3.10.X, where X is incremented automatically. We should probably increment the version number as soon as the first beta is released and we are reasonably sure we have added all new/changed API.
  • The stubs would be installed into a special directory, for example stdlib, or even a non-importable name like types-stdlib (so we'd have stubs stdlib/sys.pyi etc.) so that they are only used by type checkers that support this package and don't interfere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: policyOrganization of the typeshed project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions