python/typeshed hiện có 5.1k sao trên GitHub, viết chủ yếu bằng Python. Collection of library stubs for Python, with static types
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Typeshed contains external type annotations for the Python standard library
and Python builtins, as well as third-party packages that are contributed by
people external to those projects.
This data can, e.g., be used for static analysis, type checking, type inference,
and autocompletion.
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.
Further documentation on stub files, typeshed, and Python's typing system in
general, can also be found at https://typing.readthedocs.io/en/latest/.
Typeshed supports Python versions 3.10 to 3.14.
Using
If you're just using a type checker (e.g. mypy,
pyright, or PyCharm's built-in type
checker), as opposed to
developing it, you don't need to interact with the typeshed repo at
all: a copy of the standard library part of typeshed is bundled with type checkers.
And type stubs for third-party packages and modules you are using can
be installed from PyPI. For example, if you are using html5lib and requests,
you can install the type stubs using
$ pip install types-html5lib types-requests
These PyPI packages follow the typing spec standards
and are automatically released (up to once a day) 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.
Package versioning for third-party stubs
Version numbers of third-party stub packages consist of at least four parts.
All parts of the stub version, except for the last part, correspond to the
version of the runtime package being stubbed. For example, if the types-foo
package has version 1.2.0.20240309, this guarantees that the types-foo package
contains stubs targeted against foo==1.2.* and tested against the latest
version of foo matching that specifier. In this example, the final element
of the version number (20240309) indicates that the stub package was pushed on
March 9, 2024.
At typeshed, we try to keep breaking changes to a minimum. However, due to the
nature of stubs, any version bump can introduce changes that might make your
code fail to type check.
There are several strategies available for specifying the version of a stubs
package you're using, each with its own tradeoffs:
Use the same bounds that you use for the package being stubbed. For example,
if you use requests>=2.30.0,<2.32, you can use
types-requests>=2.30.0,<2.32. This ensures that the stubs are compatible
with the package you are using, but it carries a small risk of breaking
type checking due to changes in the stubs.
Another risk of this strategy is that stubs often lag behind
the package that is being stubbed. You might want to force the package being stubbed
to a certain minimum version because it fixes a critical bug, but if
correspondingly updated stubs have not been released, your type
checking results may not be fully accurate.
Pin the stubs to a known good version and update the pin from time to time
(either manually, or using a tool such as dependabot or renovate).
For example, if you use types-requests==2.31.0.1, you can have confidence
that upgrading dependencies will not break type checking. However, you will
miss out on improvements in the stubs that could potentially improve type
checking until you update the pin. This strategy also has the risk that the
stubs you are using might become incompatible with the package being stubbed.
Don't pin the stubs. This is the option that demands the least work from
you when it comes to updating version pins, and has the advantage that you
will automatically benefit from improved stubs whenever a new version of the
stubs package is released. However, it carries the risk that the stubs
become incompatible with the package being stubbed.
For example, if a new major version of the package is released, there's a
chance the stubs might be updated to reflect the new version of the runtime
package before you update the package being stubbed.
You can also switch between the different strategies as needed. For example,
you could default to strategy (1), but fall back to strategy (2) when
a problem arises that can't easily be fixed.
The _typeshed package
typeshed includes a package _typeshed as part of the standard library.
This package and its submodules contain utility types, but are 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.
python/typeshed thuộc nhóm Backend trên TopGit, cùng 4 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về python/typeshed ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/python/typeshed là nguồn chính thức.
python/typeshed có bao nhiêu sao?
python/typeshed có 5.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/python/typeshed. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
python/typeshed có những chủ đề gì?
GitHub topics của python/typeshed: "python", "stub", "types", "typing". TopGit xếp repo vào nhóm Backend.
python/typeshed có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho python/typeshed. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
python/typeshed có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho python/typeshed. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
python/typeshed còn đang phát triển không?
Commit gần nhất trên python/typeshed là 7 ngày trước (theo timestamp GitHub). Repo có 2.1k fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về typeshed?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về typeshed.