mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
![]() Avoid quadratic time in subsumed elements when adding a super-type of existing union elements. Reserve space in advance when adding multiple elements (from another union) to a union. Make union elements a `Box<[Type]>` instead of an `FxOrderSet`; the set doesn't buy much since the rules of union uniqueness are defined in terms of supertype/subtype, not in terms of simple type identity. Move sealed-boolean handling out of a separate `UnionBuilder::simplify` method and into `UnionBuilder::add`; now that `add` is iterating existing elements anyway, this is more efficient. Remove `UnionType::contains`, since it's now `O(n)` and we shouldn't really need it, generally we care about subtype/supertype, not type identity. (Right now it's used for `Type::Unbound`, which shouldn't even be a type.) Add support for `is_subtype_of` for the `object` type. Addresses comments on https://github.com/astral-sh/ruff/pull/13401 |
||
---|---|---|
.. | ||
src | ||
vendor/typeshed | ||
build.rs | ||
Cargo.toml | ||
README.md |
Red Knot
Semantic analysis for the red-knot project.
Vendored types for the stdlib
This crate vendors typeshed's stubs for the standard library. The vendored stubs can be found in crates/red_knot_python_semantic/vendor/typeshed
. The file crates/red_knot_python_semantic/vendor/typeshed/source_commit.txt
tells you the typeshed commit that our vendored stdlib stubs currently correspond to.
The typeshed stubs are updated every two weeks via an automated PR using the sync_typeshed.yaml
workflow in the .github/workflows
directory. This workflow can also be triggered at any time via workflow dispatch.