ruff/crates/red_knot_python_semantic/src
Carl Meyer e2a38e4c00
[red-knot] optimize is_subtype_of for literals (#17394)
## Summary

Allows us to establish that two literals do not have a subtype
relationship with each other, without having to fallback to a typeshed
Instance type, which is comparatively slow.

Improves the performance of the many-string-literals union benchmark by
5x.

## Test Plan

`cargo test -p red_knot_python_semantic` and `cargo bench --bench
red_knot`.
2025-04-14 09:42:44 -07:00
..
module_resolver Use python.typing.org for typing documentation links (#17323) 2025-04-09 20:38:20 +02:00
semantic_index [red-knot] detect unreachable attribute assignments (#16852) 2025-04-14 09:23:20 +02:00
types [red-knot] detect unreachable attribute assignments (#16852) 2025-04-14 09:23:20 +02:00
util [red-knot] Improve ergonomics for the PySlice trait (#13983) 2024-10-29 20:40:59 +00:00
ast_node_ref.rs Fixing various spelling errors (#16924) 2025-03-23 08:08:40 +00:00
db.rs [red-knot] Fix python setting in mdtests, and rewrite a site-packages test as an mdtest (#17222) 2025-04-06 18:24:32 +01:00
lib.rs [red-knot] Fix python setting in mdtests, and rewrite a site-packages test as an mdtest (#17222) 2025-04-06 18:24:32 +01:00
lint.rs Add knot.toml schema (#15735) 2025-02-07 10:59:40 +01:00
list.rs [red-knot] Don't use separate ID types for each alist (#16415) 2025-02-28 14:55:55 -05:00
module_name.rs [red-knot] Add initial support for * imports (#16923) 2025-03-24 17:15:58 +00:00
node_key.rs [red-knot] Use memory address as AST node key (#14317) 2024-11-13 14:35:54 +01:00
program.rs [red-knot] Change venv discovery (#17099) 2025-03-31 19:39:05 +02:00
python_platform.rs [red-knot] Default python-platform to current platform (#17183) 2025-04-09 12:05:18 +02:00
semantic_index.rs [red-knot] detect unreachable attribute assignments (#16852) 2025-04-14 09:23:20 +02:00
semantic_model.rs [red-knot] Goto type definition (#16901) 2025-04-02 12:12:48 +00:00
site_packages.rs [red-knot] Discover local venv folder in cli (#16917) 2025-03-28 17:59:49 +00:00
suppression.rs Use python.typing.org for typing documentation links (#17323) 2025-04-09 20:38:20 +02:00
symbol.rs [red-knot] detect unreachable attribute assignments (#16852) 2025-04-14 09:23:20 +02:00
types.rs [red-knot] optimize is_subtype_of for literals (#17394) 2025-04-14 09:42:44 -07:00
unpack.rs [red-knot] Factor out shared unpacking logic (#16595) 2025-03-28 23:52:51 +05:30