René's URL Explorer Experiment


Title: [Conformance/Spec] Type Checker Divergence in Variance Inference · Issue #2281 · python/typing · GitHub

Open Graph Title: [Conformance/Spec] Type Checker Divergence in Variance Inference · Issue #2281 · python/typing

X Title: [Conformance/Spec] Type Checker Divergence in Variance Inference · Issue #2281 · python/typing

Description: Update: Since v0.0.36 ty now also considers Foo covariant in T in the example below Currently, all type checkers pass the generics_variance_inference portion of the conformance test suite. However, there is some divergence with generic m...

Open Graph Description: Update: Since v0.0.36 ty now also considers Foo covariant in T in the example below Currently, all type checkers pass the generics_variance_inference portion of the conformance test suite. However,...

X Description: Update: Since v0.0.36 ty now also considers Foo covariant in T in the example below Currently, all type checkers pass the generics_variance_inference portion of the conformance test suite. However,...

Opengraph URL: https://github.com/python/typing/issues/2281

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Conformance/Spec] Type Checker Divergence in Variance Inference","articleBody":"**Update:** Since v0.0.36 `ty` now also considers `Foo` covariant in `T` in the example below\n\nCurrently, all type checkers pass the [`generics_variance_inference` portion of the conformance test suite](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html). However, there is some divergence with generic methods that have bound self-type: \n[[mypy]](https://mypy-play.net/?gist=2b75369999f5d7278f1ff3ab56edd03c), [[pyright]](https://pyright-play.net/?code=MYGwhgzhAEBiD28DaAVAugLgFDV9AJgKYBm0A5oQC4AUEhIxAlNALQB80KG0AdHzniKkw%2BfEgDKaWvWLcEySQBpo8SgAtCAJ24gAlhEoS0ygPTN2cREe58eWLEOiVCBgPrB4ANzCbdYAHbAhNQ%2BZHJWuv6UaOYc8kjwAEYAVoTA0dh40JpUAK6a-tChuADE0AC2AJ4ADpXKAF65iQHKlJXcgDLkgPB-yrW%2BZGqUvZU5xCDt0ICg5F1AA), [[ty]](https://play.ty.dev/f6f5b8e9-9c4e-4ef4-a559-53662c76f5f1), [[pyrefly]](https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuA2gCoC6iAOuvQPqYYYegHMYAFwAUcGFDABKegFoAfPXaJ6hXX0FCR9VJkysAyp1nyw2niGZtL9gDT1ckgBYwATtscWnG4A9Mrq9PYBzkg6euh8wqKS8JIA%2BpS4AG6oPhAYlDDSOWL%2BLKwQ6JKcYRoBuNgAVjCUVbz8gj5SAK4%2B-MUCAMT0ALakZG4AXl3YGG6SpNqAMuSA8H9uZLlinpJrpJ1gUAv0gKDky3wgLiDrIgeEkrjDUBRDAAq716T0aFh4%2BPQZ6JAxD1UJIILh0IQ%2BENzDAYPQtpJiHBEMFgld9qRCLgfGJgjB0MFMLhKHBgv9AcDQeDgvQwNjjNloKhsLA-uCKT4QWD%2BLhiFT0HBIegyF5wSpMr44Nz6ABeCIgADMhAAjAAWex8Vi%2BHzYuCcPhddAQYbEbHJTAqTAQTotCAS2X0ADkEDE6GxMEdfDdkhUnQAjl1rTALQBrGCkFSoSgFOgOx0Adxy6E96BAAF8LlHQRLGNAYBQvjgCCRyGmgA)\n\n```python\nclass Foo[T]:\n    def get(self) -> T: ...\n    def add[S](self: Foo[S], other: list[S], /) -> Foo[S]: ...\n\ndef test_covariance(arg: Foo[int]) -> Foo[object]:\n    return arg  # mypy, zuban, ty: ❌️, pyright, pyrefly: ✅️\n```\n\nFollowing the [variance inference specification](https://typing.python.org/en/latest/spec/generics.html#variance-inference), I believe `Foo` should be covariant in `T`, which is what `pyright` and `pyrefly` say, because `Foo[Dummy].add` is assignable to `Foo[object].add`. Intuitively, since `S` is method and not class scoped, and `T` does not appear in the signature of `Foo.add`, it has no bearing on variance.\n\nHowever, `mypy`, `ty` and `zuban` think `Foo` is invariant in `T`.  In https://github.com/python/mypy/pull/19466#discussion_r2432203931,  @ilevkivskyi argued that for an instance, `def add[S](self: Foo[S], other: list[S], /) -> Foo[S]: ...` is indistinguishable from `def add(self, other: list[T], /) -> Foo[T]: ...` and therefore `Foo` should be invariant in `T`.\n\nThis argumentation reveals another divergence between type checkers when it comes to subclassing generics: [[mypy]](https://mypy-play.net/?gist=0869df5e6345f426cba8dfe419ddbc5f), [[ty]](https://play.ty.dev/0e291fd1-d71f-4cd2-ae2f-5c1f8b58278a), [[pyrefly]](https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuA2gCoC6iAOuvQPqYYYegHMYAFwAUcGFDABKegFoAfPXaJ6hXX0FCR9VJkysAyp1nyw2niGZtL9gDT1ckgBYwATtqgQcJIWnG4A9Mrq9PaOIfbauoR8fNS0DOYArtjSsRDokpyKvPyCAMT0ALakZG4AXlkYbpKkbmQ%2BIlCk2oCg5IDwf62kPhBinpLagDLkvfqCwqImmNYKbh7efvQBQax5BZEa9pnY8Tq6IC4gbR2khJK4FVAU5QAKg5f0aFh4%2BPSUuOiQYhkfKhJBBfkl0OVzDAYPRRpJiHBEGEwhcwJ1CLgfGIwjB0GFMLhKHAwj8-sNAcDQXj6GBMcYAG6oaCobCwb6-f4UkG-dzEbnoODgsheX4qem%2BOBU%2BgAXmiIAAzIQAIwAFnsfFYvh8mLgnD4GXQEAqxExkhgmBUmAg7UoIPFMvoAHJhuhMTBHXxXZIVO0AI4Za3mlQAaxgpBUqEolHgDFljoA7qgfOgPegQABfM6Ru0wRjQGAUd44AgkcjpoA), [[pyright]](https://pyright-play.net/?code=MYGwhgzhAEBiD28DaAVAugLgFDV9AJgKYBm0A5oQC4AUEhIxAlNALQB80KG0AdHzniKkw%2BfEgDKaWvWLcEySQBpo8SgAtCAJ24gAlhEoS0ygPTN2cREe58eWLKEgxxAVwBG1eUl0A7SmkZsPGgAYmgAWwBPAAdI5QAvdzAfZUo46FjNEhBI7kBQckB4P%2BVM3TI1Sm5AGXICgVwhaBF8aQZlVQ1taD0Dbz8A1g5XNxs%2BIA)\n\n```python\nclass Foo[T]:\n    def get(self) -> T: ...\n    def add[S](self: Foo[S], other: list[S], /) -> Foo[S]: ...\n\nclass Sub(Foo[int]):\n    # mypy, zuban, ty, pyrefly: ✅️, pyright: ❌️\n    def add(self, other: list[int]) -> Sub: ...\n```\n\n(I believe `pyright` is correct to error here, as for example a function that expects a `Foo[int]` could in principle try to call `type(arg).add(Foo[str](), [\"a\", \"b\", \"c\"])`)\n\nNotably, if we remove the `self: Foo[S]` annotation, then the inference changes:\n[[mypy]](https://mypy-play.net/?gist=942e7831ef27d9365ab249a2f48cc1b0), [[pyright]](https://pyright-play.net/?code=MYGwhgzhAEBiD28DaAVAugLgFDV9AJgKYBm0A5oQC4AUEhIxAlNALQB80KG0AdHzniKkw%2BfEgDKaWvWIAaaPEoALQgCduIAJYRKEtPID0zdnER7ufHlixDolQjoD6weADcwqzWAB2wQtQ8ybgRkTW9KNGMOEKR4ACMAK0JgCOw8aFUqAFdVb2hA3ABiaABbAE8ABzL5SmroKs8yJUp5BpIQOoAvLLifbkBQckB4P%2BtQSBhxHuoYsIjGNLxi2oHB0sq6hs0mluhu3u9WssziDu5AGXJh9NsRfGkGeUUVdWgtHSQZyNYOCbiLPiA), [[pyrefly]](https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuA2gCoC6iAOuvQPqYYYegHMYAFwAUcGFDABKegFoAfPXaJ6hXX0FCR9VJkysAyp1nywAGnq5JACxgAnbVAhxJFzvYD0yur0PCDMbJah2rqEfHzCopLwkgD6lLgAbqiuEBiUMNLZYtrhrBDokpxBGqW42ABWMJSVvPyCrlIArq78RQIAxPQAtqRk9pKk9mQ5Yk6SU6QdYFCT9ABendgY2oCg5IDwf3Ho1LQM5pvSpeWViq0GgxO7e8Ojq9MQs-PrmxgLSyvagBlyA5tAQJYymawKeyOFzueiebxlCpVVQaUJnbBRHS6EC2EDTEQrQiSXBDKAUQYABUWhNI9DQWDw%2BHo6XQkDE3VQkgguHQsXQg3MMBg9DmkmIcEQ-n8BOWpEIuFcYn8MHQ-kwuEocH8rPZnO5vP89DAiuMWWgqGwsBZvL1ri5PP4uGIBvQcH5ZGcvJUGTccEd9AAvCEQABmQgARgALKE%2BKw3K5FXBOHxOugIENiIqkpgVJgIB1mhBfUH6AByd7oRUwMt8KuSFQdACOnQLMFzAGsYKQVKhKPk6KWywB3bLoWvoEAAXzxfe5vsY0BgFAZOAIJHIU6AA), [[ty]](https://play.ty.dev/36714b64-0db5-486f-9a30-30a9ff645b58)\n\n```python\nclass Foo[T]:\n    def get(self) -> T: ...\n    def add[S](self, other: list[S], /) -> Foo[S]: ...\n\ndef test_covariance(arg: Foo[int]) -> Foo[object]:\n    return arg  # mypy, ty, pyright, pyrefly, zuban: ✅️\n\nclass Sub(Foo[int]):\n    # ty: ✅️ mypy, pyright, zuban, pyrefly: ❌️\n    def add(self, other: list[int]) -> Sub: ...\n```\n\n## What's needed\n\nType checker divergence in variance inference is quite insidious; I believe the spec should be clarified in this regard and examples like the ones in this issue should be added to the conformance suite.\n\nI believe that `pyright` is the only type checker with correct behavior here at the moment, but maybe @erictraut can comment on these examples, and as there is some disagreement, at least from the `mypy` maintainers, I believe this needs some discussion.\n\n## References / Other Discussions\n\n- https://github.com/python/mypy/issues/19439\n- https://github.com/python/mypy/issues/20644\n- https://github.com/python/mypy/issues/18334\n- https://github.com/python/mypy/pull/19466","author":{"url":"https://github.com/randolf-scholz","@type":"Person","name":"randolf-scholz"},"datePublished":"2026-05-10T15:11:13Z","url":"https://github.com/python/typing/issues/2281"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b47b1b89-5d83-78b8-897b-2f5267f4c2bf
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9066:160FAB:BD2E2:1094A2:6B0052A2
html-safe-nonceec07e4b55aeb518f395f53a32ccb2432b220fa6b3a587bb5eb9c3422d94b630f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDY2OjE2MEZBQjpCRDJFMjoxMDk0QTI6NkIwMDUyQTIiLCJ2aXNpdG9yX2lkIjoiODA1NTc3OTQ3OTgxMDc1NzI4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6f2b3e944976d8e2d83a10d781688a374c2be7ef7f81e14e407432c33ac4a504
hovercard-subject-tagissue:4415979804
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typing/2281/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0f6205254babcd54fc5d7c0a0ad30e7f22e75940f98c420241b29bb948f2caa9/python/typing/issues/2281
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0f6205254babcd54fc5d7c0a0ad30e7f22e75940f98c420241b29bb948f2caa9/python/typing/issues/2281
og:image:altUpdate: Since v0.0.36 ty now also considers Foo covariant in T in the example below Currently, all type checkers pass the generics_variance_inference portion of the conformance test suite. However,...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerandolf-scholz
hostnamegithub.com
expected-hostnamegithub.com
Nonef420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb
turbo-cache-controlno-preview
go-importgithub.com/python/typing git https://github.com/python/typing.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id24604008
octolytics-dimension-repository_nwopython/typing
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24604008
octolytics-dimension-repository_network_root_nwopython/typing
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26e00df917aba0f128135dc073ea0c5e33a70d40
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/2281#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F2281
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F2281
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Ftyping
Reloadhttps://github.com/python/typing/issues/2281
Reloadhttps://github.com/python/typing/issues/2281
Reloadhttps://github.com/python/typing/issues/2281
pythonhttps://github.com/python
typinghttps://github.com/python/typing
Codehttps://github.com/python/typing
Issues206 (206)https://github.com/python/typing/issues
Pull requests27 (27)https://github.com/python/typing/pulls
Discussionshttps://github.com/python/typing/discussions
Actionshttps://github.com/python/typing/actions
Security and qualityhttps://github.com/python/typing/security
Insightshttps://github.com/python/typing/insights
https://github.com/python/typing
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/2281
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/2281
#2287https://github.com/python/typing/pull/2287
[Conformance/Spec] Type Checker Divergence in Variance Inferencehttps://github.com/python/typing/issues/2281#top
#2287https://github.com/python/typing/pull/2287
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
on May 10, 2026https://github.com/python/typing/issues/2281#issue-4415979804
generics_variance_inference portion of the conformance test suitehttps://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html
[mypy]https://mypy-play.net/?gist=2b75369999f5d7278f1ff3ab56edd03c
[pyright]https://pyright-play.net/?code=MYGwhgzhAEBiD28DaAVAugLgFDV9AJgKYBm0A5oQC4AUEhIxAlNALQB80KG0AdHzniKkw%2BfEgDKaWvWLcEySQBpo8SgAtCAJ24gAlhEoS0ygPTN2cREe58eWLEOiVCBgPrB4ANzCbdYAHbAhNQ%2BZHJWuv6UaOYc8kjwAEYAVoTA0dh40JpUAK6a-tChuADE0AC2AJ4ADpXKAF65iQHKlJXcgDLkgPB-yrW%2BZGqUvZU5xCDt0ICg5F1AA
[ty]https://play.ty.dev/f6f5b8e9-9c4e-4ef4-a559-53662c76f5f1
[pyrefly]https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuA2gCoC6iAOuvQPqYYYegHMYAFwAUcGFDABKegFoAfPXaJ6hXX0FCR9VJkysAyp1nyw2niGZtL9gDT1ckgBYwATtscWnG4A9Mrq9PYBzkg6euh8wqKS8JIA%2BpS4AG6oPhAYlDDSOWL%2BLKwQ6JKcYRoBuNgAVjCUVbz8gj5SAK4%2B-MUCAMT0ALakZG4AXl3YGG6SpNqAMuSA8H9uZLlinpJrpJ1gUAv0gKDky3wgLiDrIgeEkrjDUBRDAAq716T0aFh4%2BPQZ6JAxD1UJIILh0IQ%2BENzDAYPQtpJiHBEMFgld9qRCLgfGJgjB0MFMLhKHBgv9AcDQeDgvQwNjjNloKhsLA-uCKT4QWD%2BLhiFT0HBIegyF5wSpMr44Nz6ABeCIgADMhAAjAAWex8Vi%2BHzYuCcPhddAQYbEbHJTAqTAQTotCAS2X0ADkEDE6GxMEdfDdkhUnQAjl1rTALQBrGCkFSoSgFOgOx0Adxy6E96BAAF8LlHQRLGNAYBQvjgCCRyGmgA
variance inference specificationhttps://typing.python.org/en/latest/spec/generics.html#variance-inference
python/mypy#19466 (comment)https://github.com/python/mypy/pull/19466#discussion_r2432203931
@ilevkivskyihttps://github.com/ilevkivskyi
[mypy]https://mypy-play.net/?gist=0869df5e6345f426cba8dfe419ddbc5f
[ty]https://play.ty.dev/0e291fd1-d71f-4cd2-ae2f-5c1f8b58278a
[pyrefly]https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuA2gCoC6iAOuvQPqYYYegHMYAFwAUcGFDABKegFoAfPXaJ6hXX0FCR9VJkysAyp1nyw2niGZtL9gDT1ckgBYwATtqgQcJIWnG4A9Mrq9PaOIfbauoR8fNS0DOYArtjSsRDokpyKvPyCAMT0ALakZG4AXlkYbpKkbmQ%2BIlCk2oCg5IDwf62kPhBinpLagDLkvfqCwqImmNYKbh7efvQBQax5BZEa9pnY8Tq6IC4gbR2khJK4FVAU5QAKg5f0aFh4%2BPSUuOiQYhkfKhJBBfkl0OVzDAYPRRpJiHBEGEwhcwJ1CLgfGIwjB0GFMLhKHAwj8-sNAcDQXj6GBMcYAG6oaCobCwb6-f4UkG-dzEbnoODgsheX4qem%2BOBU%2BgAXmiIAAzIQAIwAFnsfFYvh8mLgnD4GXQEAqxExkhgmBUmAg7UoIPFMvoAHJhuhMTBHXxXZIVO0AI4Za3mlQAaxgpBUqEolHgDFljoA7qgfOgPegQABfM6Ru0wRjQGAUd44AgkcjpoA
[pyright]https://pyright-play.net/?code=MYGwhgzhAEBiD28DaAVAugLgFDV9AJgKYBm0A5oQC4AUEhIxAlNALQB80KG0AdHzniKkw%2BfEgDKaWvWLcEySQBpo8SgAtCAJ24gAlhEoS0ygPTN2cREe58eWLKEgxxAVwBG1eUl0A7SmkZsPGgAYmgAWwBPAAdI5QAvdzAfZUo46FjNEhBI7kBQckB4P%2BVM3TI1Sm5AGXICgVwhaBF8aQZlVQ1taD0Dbz8A1g5XNxs%2BIA
[mypy]https://mypy-play.net/?gist=942e7831ef27d9365ab249a2f48cc1b0
[pyright]https://pyright-play.net/?code=MYGwhgzhAEBiD28DaAVAugLgFDV9AJgKYBm0A5oQC4AUEhIxAlNALQB80KG0AdHzniKkw%2BfEgDKaWvWIAaaPEoALQgCduIAJYRKEtPID0zdnER7ufHlixDolQjoD6weADcwqzWAB2wQtQ8ybgRkTW9KNGMOEKR4ACMAK0JgCOw8aFUqAFdVb2hA3ABiaABbAE8ABzL5SmroKs8yJUp5BpIQOoAvLLifbkBQckB4P%2BtQSBhxHuoYsIjGNLxi2oHB0sq6hs0mluhu3u9WssziDu5AGXJh9NsRfGkGeUUVdWgtHSQZyNYOCbiLPiA
[pyrefly]https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQBiuuA2gCoC6iAOuvQPqYYYegHMYAFwAUcGFDABKegFoAfPXaJ6hXX0FCR9VJkysAyp1nywAGnq5JACxgAnbVAhxJFzvYD0yur0PCDMbJah2rqEfHzCopLwkgD6lLgAbqiuEBiUMNLZYtrhrBDokpxBGqW42ABWMJSVvPyCrlIArq78RQIAxPQAtqRk9pKk9mQ5Yk6SU6QdYFCT9ABendgY2oCg5IDwf3Ho1LQM5pvSpeWViq0GgxO7e8Ojq9MQs-PrmxgLSyvagBlyA5tAQJYymawKeyOFzueiebxlCpVVQaUJnbBRHS6EC2EDTEQrQiSXBDKAUQYABUWhNI9DQWDw%2BHo6XQkDE3VQkgguHQsXQg3MMBg9DmkmIcEQ-n8BOWpEIuFcYn8MHQ-kwuEocH8rPZnO5vP89DAiuMWWgqGwsBZvL1ri5PP4uGIBvQcH5ZGcvJUGTccEd9AAvCEQABmQgARgALKE%2BKw3K5FXBOHxOugIENiIqkpgVJgIB1mhBfUH6AByd7oRUwMt8KuSFQdACOnQLMFzAGsYKQVKhKPk6KWywB3bLoWvoEAAXzxfe5vsY0BgFAZOAIJHIU6AA
[ty]https://play.ty.dev/36714b64-0db5-486f-9a30-30a9ff645b58
@erictrauthttps://github.com/erictraut
[PEP 695] Incorrect Variance Computation with Polymorphic Constructor. mypy#19439https://github.com/python/mypy/issues/19439
Generic method in generic class impacting type signature of unrelated method mypy#20644https://github.com/python/mypy/issues/20644
generic is incorrectly inferred as invariant if class uses Self type on an attribute mypy#18334https://github.com/python/mypy/issues/18334
[PEP 695] Fix incorrect Variance Computation with Polymorphic Methods. mypy#19466https://github.com/python/mypy/pull/19466
https://github.com/MeGaGiGaGon
MeGaGiGaGonhttps://github.com/MeGaGiGaGon
on Jun 15, 2026https://github.com/python/typing/issues/2281#issuecomment-4710679315
Post I made in the python discordhttps://discordapp.com/channels/267624335836053506/891788761371906108/1514767398392037406
JelleZijlstrahttps://github.com/JelleZijlstra
completedhttps://github.com/python/typing/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#2287https://github.com/python/typing/pull/2287
on Aug 8, 2026https://github.com/python/typing/issues/2281#event-29162281675
JPHutchinshttps://github.com/JPHutchins
on Nov 7, 2026https://github.com/python/typing/issues/2281#event-35417877481
Only keep self bound to a type variable when it refines the old solutionhttps://github.com/JPHutchins/mypy/commit/f3d026c361c8f544d88026fde16ac5b86b0e638b
f3d026chttps://github.com/JPHutchins/mypy/commit/f3d026c361c8f544d88026fde16ac5b86b0e638b
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/2281
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/2281
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.