You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Alex Waygood a92da58328
Add `@type_check_only` to two fictional classes in `builtins.pyi` (#8531)
22 hours ago
.github/workflows Temporarily pin stubtest to 3.10.5 (#8511) 3 days ago
scripts refactor: prefer f-strings to other format/concatentation styles (#8474) 1 week ago
stdlib Add `@type_check_only` to two fictional classes in `builtins.pyi` (#8531) 22 hours ago
stubs setuptools: delete _distutils.command.check.HAS_DOCUTILS (#8529) 1 day ago
test_cases Improve constructor for `builtins.dict` (#8517) 2 days ago
tests refactor: prefer f-strings to other format/concatentation styles (#8474) 1 week ago
.editorconfig Add `.editorconfig` file (#6771) 7 months ago
.flake8 Enable flake8-pyi's Y034 check in `stdlib/typing.pyi` (#8530) 24 hours ago
.gitignore Add caldav third-party stubs (#5684) 1 year ago
.pre-commit-config.yaml Upgrade flake8 to 5.0.4 (#8507) 3 days ago
CONTRIBUTING.md Clean up a few Python 2 remnants (#8452) 2 weeks ago
LICENSE minor wording fixes in LICENSE 7 years ago
MAINTAINERS.md Move Rune Tynan to former maintainers (#8306) 4 weeks ago
README.md Update README badges (#8323) 4 weeks ago
pyproject.toml Clean up a few Python 2 remnants (#8452) 2 weeks ago
pyrightconfig.json Use error codes for type ignores (#8280) 1 month ago
pyrightconfig.stricter.json Use typeshed.Incomplete and object instead of Any in tkinter stubs (#8458) 1 week ago
requirements-tests.txt Upgrade flake8 to 5.0.4 (#8507) 3 days ago

README.md

typeshed

Tests Chat at https://gitter.im/python/typing Pull Requests Welcome

About

Typeshed contains external type annotations for the Python standard library and Python builtins, as well as third party packages as contributed by people external to those projects.

This data can e.g. be used for static analysis, type checking or type inference.

For information on how to use typeshed, read below. Information for contributors can be found in CONTRIBUTING.md. Please read it before submitting pull requests; do not report issues with annotations to the project the stubs are for, but instead report them here to typeshed.

Typeshed supports Python versions 3.7 and up.

Using

If you're just using mypy (or pytype or PyCharm), as opposed to developing it, you don't need to interact with the typeshed repo at all: a copy of standard library part of typeshed is bundled with mypy. And type stubs for third party packages and modules you are using can be installed from PyPI. For example, if you are using six and requests, you can install the type stubs using

$ pip install types-six types-requests

These PyPI packages follow PEP 561 and are automatically released (multiple times a day, when needed) by typeshed internal machinery.

Type checkers should be able to use these stub packages when installed. For more details, see the documentation for your type checker.

The _typeshed package

typeshed includes a package _typeshed as part of the standard library. This package and its submodules contains utility types, but is not available at runtime. For more information about how to use this package, see the stdlib/_typeshed directory.

Discussion

If you've run into behavior in the type checker that suggests the type stubs for a given library are incorrect or incomplete, we want to hear from you!

Our main forum for discussion is the project's GitHub issue tracker. This is the right place to start a discussion of any of the above or most any other topic concerning the project.

If you have general questions about typing with Python, or you need a review of your type annotations or stubs outside of typeshed, head over to our discussion forum. For less formal discussion, try the typing chat room on gitter.im. Some typeshed maintainers are almost always present; feel free to find us there and we're happy to chat. Substantive technical discussion will be directed to the issue tracker.