Skip to content

added variance inference test with method scoped type variable#2287

Open
randolf-scholz wants to merge 8 commits into
python:mainfrom
randolf-scholz:variance_inference_with_bound_self
Open

added variance inference test with method scoped type variable#2287
randolf-scholz wants to merge 8 commits into
python:mainfrom
randolf-scholz:variance_inference_with_bound_self

Conversation

@randolf-scholz

Copy link
Copy Markdown
Contributor

Fixes #2281

This adds a conformance test checking that method scoped type-variables do not influence variance inference, in accordance with the spec.

@randolf-scholz

Copy link
Copy Markdown
Contributor Author

Actually, let's delay until ty 0.0.36 release (astral-sh/ty#1459)

@davidhalter

Copy link
Copy Markdown
Collaborator

I understand why you want to clarify this and I'm generally supportive.

Would this be considered a spec change? I'm not quite sure if this should be documented and therefore might need a discuss thread. In any case I would like to at least hear the opinions of the Mypy devs here.

@randolf-scholz randolf-scholz force-pushed the variance_inference_with_bound_self branch from f7047e3 to d2d1470 Compare July 9, 2026 18:12
@srittau srittau added the topic: conformance tests Issues with the conformance test suite label Jul 9, 2026
Comment thread conformance/results/basilisk/generics_variance_inference.toml Outdated
Comment thread conformance/tests/generics_variance_inference.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: conformance tests Issues with the conformance test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Conformance/Spec] Type Checker Divergence in Variance Inference

4 participants