mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +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 |
||
---|---|---|
.. | ||
module_resolver | ||
semantic_index | ||
types | ||
ast_node_ref.rs | ||
db.rs | ||
lib.rs | ||
module_name.rs | ||
node_key.rs | ||
program.rs | ||
python_version.rs | ||
semantic_index.rs | ||
semantic_model.rs | ||
site_packages.rs | ||
stdlib.rs | ||
types.rs |