ruff/crates
Douglas Creager 83134fb380
[ty] Handle nested types when creating specializations from constraint sets (#21530)
#21414 added the ability to create a specialization from a constraint
set. It handled mutually constrained typevars just fine, e.g. given `T ≤
int ∧ U = T` we can infer `T = int, U = int`.

But it didn't handle _nested_ constraints correctly, e.g. `T ≤ int ∧ U =
list[T]`. Now we do! This requires doing a fixed-point "apply the
specialization to itself" step to propagate the assignments of any
nested typevars, and then a cycle detection check to make sure we don't
have an infinite expansion in the specialization.

This gets at an interesting nuance in our constraint set structure that
@sharkdp has asked about before. Constraint sets are BDDs, and each
internal node represents an _individual constraint_, of the form `lower
≤ T ≤ upper`. `lower` and `upper` are allowed to be other typevars, but
only if they appear "later" in the arbitary ordering that we establish
over typevars. The main purpose of this is to avoid infinite expansion
for mutually constrained typevars.

However, that restriction doesn't help us here, because only applies
when `lower` and `upper` _are_ typevars, not when they _contain_
typevars. That distinction is important, since it means the restriction
does not affect our expressiveness: we can always rewrite `Never ≤ T ≤
U` (a constraint on `T`) into `T ≤ U ≤ object` (a constraint on `U`).
The same is not true of `Never ≤ T ≤ list[U]` — there is no "inverse" of
`list` that we could apply to both sides to transform this into a
constraint on a bare `U`.
2025-11-19 17:37:16 -05:00
..
ruff Fix analyze graph tests on windows (#21481) 2025-11-16 18:27:07 +00:00
ruff_annotate_snippets Only render hyperlinks for terminals known to support them (#21519) 2025-11-19 10:02:58 +01:00
ruff_benchmark [ty] tighten up handling of subscripts in type expressions (#21503) 2025-11-18 10:43:07 -08:00
ruff_cache Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_db Only render hyperlinks for terminals known to support them (#21519) 2025-11-19 10:02:58 +01:00
ruff_dev Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
ruff_diagnostics Fix rust feature activation (#20012) 2025-08-21 09:26:06 +02:00
ruff_formatter [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
ruff_graph `analyze`: Add option to skip over imports in `TYPE_CHECKING` blocks (#21472) 2025-11-16 12:30:24 +00:00
ruff_index Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
ruff_linter [`flake8-bandit`] Support new PySNMP API paths (`S508`, `S509`) (#21374) 2025-11-19 15:03:23 -05:00
ruff_macros Document when a rule was added (#21035) 2025-10-23 14:48:41 -04:00
ruff_memory_usage [ty] Clean up inherited generic contexts (#20647) 2025-10-03 13:55:43 -04:00
ruff_notebook [ty] Respect notebook cell boundaries when adding an auto import (#21322) 2025-11-13 18:58:08 +01:00
ruff_options_metadata Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
ruff_python_ast [`ruff`] Ignore `str()` when not used for simple conversion (`RUF065`) (#21330) 2025-11-10 18:04:41 -05:00
ruff_python_ast_integration_tests Disallow implicit concatenation of t-strings and other string types (#19485) 2025-07-27 12:41:03 +00:00
ruff_python_codegen Configurable "unparse mode" for `ruff_python_codegen::Generator` (#21041) 2025-10-24 15:44:48 +00:00
ruff_python_formatter Respect `fmt: skip` for compound statements on single line (#20633) 2025-11-18 12:02:09 -06:00
ruff_python_importer [ty] Respect notebook cell boundaries when adding an auto import (#21322) 2025-11-13 18:58:08 +01:00
ruff_python_index Track t-strings and f-strings for token-based rules and suppression comments (#20357) 2025-09-12 13:00:12 -05:00
ruff_python_literal Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
ruff_python_parser [ty] name is parameter and global is a syntax error (#21312) 2025-11-14 18:15:34 +00:00
ruff_python_semantic [`pyflakes`] Revert to stable behavior if imports for module lie in alternate branches for `F401` (#20878) 2025-10-27 10:23:36 -05:00
ruff_python_stdlib [`ruff`] Extend FA102 with listed PEP 585-compatible APIs (#20659) 2025-10-03 09:45:32 -04:00
ruff_python_trivia Handle t-string prefixes in `SimpleTokenizer` (#20578) 2025-09-25 14:33:37 -05:00
ruff_python_trivia_integration_tests Handle t-string prefixes in `SimpleTokenizer` (#20578) 2025-09-25 14:33:37 -05:00
ruff_server Set the diagnostic URL for lint errors (#21514) 2025-11-18 13:34:50 -05:00
ruff_source_file Move diff rendering to `ruff_db` (#20006) 2025-08-21 09:47:00 -04:00
ruff_text_size [`ruff`] Update schemars to v1 (#20942) 2025-10-20 08:59:52 +02:00
ruff_wasm Bump 0.14.5 (#21435) 2025-11-13 14:37:31 -05:00
ruff_workspace `analyze`: Add option to skip over imports in `TYPE_CHECKING` blocks (#21472) 2025-11-16 12:30:24 +00:00
ty [ty] Exit with `2` if there's any IO error (#21508) 2025-11-19 09:39:19 +01:00
ty_combine [ty] Disallow std::env and io methods in most ty crates (#20046) 2025-08-22 11:13:47 -07:00
ty_completion_eval [ty] Sync vendored typeshed stubs (#21466) 2025-11-15 17:12:32 +00:00
ty_ide [ty] Semantic tokens: consistently add the `DEFINITION` modifier (#21521) 2025-11-19 12:45:39 +01:00
ty_project [ty] Fix `--exclude` and `src.exclude` merging (#21341) 2025-11-10 12:52:45 +01:00
ty_python_semantic [ty] Handle nested types when creating specializations from constraint sets (#21530) 2025-11-19 17:37:16 -05:00
ty_server [ty] Semantic tokens: consistently add the `DEFINITION` modifier (#21521) 2025-11-19 12:45:39 +01:00
ty_static [ty] improve base conda distinction from child conda (#20675) 2025-10-03 13:56:06 +00:00
ty_test [ty] Provide proper error on dangling revealed (#21416) 2025-11-16 08:34:54 +00:00
ty_vendored [ty] Create a specialization from a constraint set (#21414) 2025-11-19 14:20:33 -05:00
ty_wasm [ty] Inlay hint call argument location (#20349) 2025-11-17 11:33:09 +01:00