Skip to content

Fix PEP 695 ParamSpec crashes - #519

Merged
JelleZijlstra merged 1 commit into
mainfrom
codex/fix-pep695-paramspec
Aug 13, 2026
Merged

Fix PEP 695 ParamSpec crashes#519
JelleZijlstra merged 1 commit into
mainfrom
codex/fix-pep695-paramspec

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • handle P.args and P.kwargs when a PEP 695 ParamSpec is represented internally as an input signature
  • normalize flat ParamSpec specializations before constructor type-parameter substitution
  • exclude runtime __type_params__ metadata from protocol requirements
  • temporarily allowlist the non-crashing conformance changes introduced by parameter specification/type variable tuple variance python/typing#2215

Root cause

PEP 695 ParamSpecs use pycroscope's canonical InputSigValue representation directly, while several older paths expected runtime partial-call or ordinary gradual values. Attribute lookup and generic subscripting consequently sent these non-gradual values through replace_fallback() or gradual assignability. Constructor specialization also treated flat ParamSpec arguments as scalar types instead of single-parameter callable signatures.

The protocol mismatch was separate: runtime PEP 695 classes expose __type_params__, and pycroscope was accidentally including that metadata in structural protocol members.

The full conformance suite was run against the exact head of python/typing#2215. It now reports no internal errors and matches the updated known-failure list.

The floating taxonomy check exposed additional non-crashing findings in newly pushed taxonomy code. Those are addressed by taxonomy#83, whose pycroscope workflow passes; the currently red third-party check on this PR predates that follow-up.

@JelleZijlstra
JelleZijlstra merged commit 2bd2601 into main Aug 13, 2026
14 of 16 checks passed
@JelleZijlstra
JelleZijlstra deleted the codex/fix-pep695-paramspec branch August 13, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant