Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Extend Generator assignability workaround to Python 3.13+#25472

Merged
carljm merged 3 commits into
mainfrom
cjm/fix-spurious-async-None
Jun 1, 2026
Merged

[ty] Extend Generator assignability workaround to Python 3.13+#25472
carljm merged 3 commits into
mainfrom
cjm/fix-spurious-async-None

Conversation

@carljm

@carljm carljm commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Keep the Generator nominal-assignability special case enabled on Python 3.13+ to avoid spurious None inference through close() -> ReturnT | None.

Closes astral-sh/ty#3583

Testing

Added a regression mdtest.

@astral-sh-bot astral-sh-bot Bot added the ty Multi-file analysis & type inference label May 30, 2026
@astral-sh-bot astral-sh-bot Bot changed the title Extend Generator assignability workaround to Python 3.13+ [ty] Extend Generator assignability workaround to Python 3.13+ May 30, 2026
@astral-sh-bot

astral-sh-bot Bot commented May 30, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 91.94%. The percentage of expected errors that received a diagnostic held steady at 87.09%. The number of fully passing files held steady at 92/134.

@astral-sh-bot

astral-sh-bot Bot commented May 30, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented May 30, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff (timing results)

@carljm carljm marked this pull request as ready for review June 1, 2026 14:18
@astral-sh-bot astral-sh-bot Bot requested a review from dhruvmanila June 1, 2026 14:18
carljm added 2 commits June 1, 2026 08:03
* main:
  [`pydocstyle`] Improve discoverability of rules enabled for each convention (#24973)
  [ty] Deduplicate retained use-def place states (#25450)
  [ty] reduce features of low-level crates depended on by `ty_python_semantic` (#25524)
  [ty] Fix narrowing enum literal unions by member identity (#25520)
  [ty] Test tagged union narrowing for named tuples (#25519)
  [ty] Disallow file-system access in `ty_python_core` (#25518)
  [ty] Nominal Tagged Union Narrowing (#24916)
  Commit `scripts/uv.lock` (#25517)
  Fix potential index out of range in `LineIndex` computation (#25492)
  [ty] Sync vendored typeshed stubs (#25514)
  [ty] Add disjointness for protocol method members (#25315)
  [ty] Use compact sets for more immutable fields (#25476)
  [ty] Derive `Default` for `FunctionDecoratorInference` (#25482)
  [ty] Ignore rejected assignments for synthesized bindings (#25340)
  [ty] Handle cycles in function decorator inference (#25475)
  docs: fix typo `bin/active` → `bin/activate` in tutorial (#25473)
  [ty] Narrow bound method overloads by receiver (#24707)
@carljm carljm enabled auto-merge (squash) June 1, 2026 15:07
@carljm carljm merged commit b82dfe7 into main Jun 1, 2026
58 checks passed
@carljm carljm deleted the cjm/fix-spurious-async-None branch June 1, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect invalid-return-type for constrained generics in async functions

3 participants