[ty] don't eagerly unpack aliases in user-authored unions by carljm · Pull Request #20055 · astral-sh/ruff (original) (raw)
added the ty
Multi-file analysis & type inference
label
carljm marked this pull request as draft
carljm changed the title
[ty] fix a recursive alias case via less eager union simplification [ty] don't eagerly unpack aliases in user-authored unions
carljm marked this pull request as ready for review
carljm deleted the cjm/aliasinunion branch
carljm added a commit to leandrobbraga/ruff that referenced this pull request
- main:
[
ruff] Preserve relative whitespace in multi-line expressions (RUF033) (astral-sh#19647) [ty] Optimize TDD atom ordering (astral-sh#20098) [airflow] ExtendAIR311andAIR312rules (astral-sh#20082) [ty] Preserve qualifiers when accessing attributes on unions/intersections (astral-sh#20114) [ty] Fix the inferred interface of specialized generic protocols (astral-sh#19866) [ty] Infer slightly more precise types for comprehensions (astral-sh#20111) [ty] Add more tests for protocols (astral-sh#20095) [ty] don't eagerly unpack aliases in user-authored unions (astral-sh#20055) [flake8-use-pathlib] Update links to the table showing the correspondence betweenosandpathlib(astral-sh#20103) [flake8-use-pathlib] MakePTH100fix unsafe because it can change behavior (astral-sh#20100) [flake8-use-pathlib] Delete unusedRule::OsSymlinkenabled check (astral-sh#20099) [ty] Add search paths info to unresolved import diagnostics (astral-sh#20040) [flake8-logging-format] Add auto-fix for f-string logging calls (G004) (astral-sh#19303) Add aScopeKindfor the__class__cell (astral-sh#20048) Fix incorrect D413 links in docstrings convention FAQ (astral-sh#20089) [ty] Refactor inlay hints structure to use separate parts (astral-sh#20052)
second-ed pushed a commit to second-ed/ruff that referenced this pull request
Summary
Add a subtly different test case for recursive PEP 695 type aliases, which does require that we relax our union simplification, so we don't eagerly unpack aliases from user-provided union annotations.
Test Plan
Added mdtest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})