René's URL Explorer Experiment


Title: Use self-type in `__init__` to add extra generic types · Issue #16752 · python/mypy · GitHub

Open Graph Title: Use self-type in `__init__` to add extra generic types · Issue #16752 · python/mypy

X Title: Use self-type in `__init__` to add extra generic types · Issue #16752 · python/mypy

Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.

Open Graph Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.

X Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.

Opengraph URL: https://github.com/python/mypy

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use self-type in `__init__` to add extra generic types","articleBody":"**Feature**\r\n\r\n\u003c!-- Enter a clear and concise description of your feature proposal here. -->\r\n\r\nAllow using self-types to add intermediate generic types for `__init__`.\r\n\r\n**Pitch**\r\n\r\n\u003c!-- Please explain why this feature should be implemented and how it would be used. Add examples, if applicable. -->\r\n\r\nThis would make https://github.com/python-trio/trio/pull/2898 possible to type well without the awful hacks we had to do. Specifically making sure `RaisesGroup(RaisesGroup(ValueError))` is `RaisesGroup[ExceptionGroup[ValueError]]`.\r\n\r\nPerhaps a code sample would make more sense:\r\n\r\n```py\r\nfrom typing import Generic, TypeVar, overload\r\n\r\nE = TypeVar(\"E\", bound=BaseException)\r\nE2 = TypeVar(\"E2\", bound=BaseException)\r\n\r\nclass RaisesGroup(Generic[E]):\r\n    @overload\r\n    def __init__(self, a: type[E]):\r\n        ...\r\n    \r\n    @overload\r\n    def __init__(self: \"RaisesGroup[BaseExceptionGroup[E2]]\", a: \"RaisesGroup[E2]\"):\r\n        ...\r\n    \r\n    def __init__(self, a: object):\r\n        ...\r\n\r\n\r\nRaisesGroup(RaisesGroup(ValueError))  # currently: Argument 1 to \"RaisesGroup\" has incompatible type \"RaisesGroup[ValueError]\"; expected \"RaisesGroup[Never]\"\r\n```","author":{"url":"https://github.com/A5rocks","@type":"Person","name":"A5rocks"},"datePublished":"2024-01-06T03:51:28Z","url":"https://github.com/python/mypy/issues/16752"}

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/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:0ae1b2a9-0846-2886-f44b-9be42b49870e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id983C:1FBEEF:EC8AF3:1327F94:6AFFEE68
html-safe-nonce97e15e9a32d29a78db3988218d8951f75208c56678fde82ed371eb64c007c1ee
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODNDOjFGQkVFRjpFQzhBRjM6MTMyN0Y5NDo2QUZGRUU2OCIsInZpc2l0b3JfaWQiOiIzNjUyODM5NDQxODgzNDU5MTc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac05fdc0b03b202f2d5b0cbf8e5a1f115568bfd40e6a12b0fc264322b4e91b8082
hovercard-subject-tagrepository:7053637
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/mypy/issues/16752
twitter:imagehttps://opengraph.githubassets.com/850ce2019117db99c166b712132547c2dade118d4084179fa6a2ee39e584b4de/python/mypy
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/850ce2019117db99c166b712132547c2dade118d4084179fa6a2ee39e584b4de/python/mypy
og:image:altOptional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
turbo-cache-controlno-cache
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/16752#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F16752
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%2Fmypy%2Fissues%2F16752
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/16752
Reloadhttps://github.com/python/mypy/issues/16752
Reloadhttps://github.com/python/mypy/issues/16752
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16752
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16752
Use self-type in __init__ to add extra generic typeshttps://github.com/python/mypy/issues/16752#top
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jan 6, 2024https://github.com/python/mypy/issues/16752#issue-2068346094
python-trio/trio#2898https://github.com/python-trio/trio/pull/2898
A5rockshttps://github.com/A5rocks
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
on Jan 6, 2024https://github.com/python/mypy/issues/16752#event-11406944161
A5rockshttps://github.com/A5rocks
on Jan 6, 2024https://github.com/python/mypy/issues/16752#event-11406944398
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Jan 6, 2024https://github.com/python/mypy/issues/16752#issuecomment-1879531244
pyright accepts the above codehttps://pyright-play.net/?code=GYJw9gtgBALgngBwJYDsDmUkQWEMoDiApikSEgMYA0UAKokQGoCGINYAbmQDZjMAmAKEEBRKAF46DFiAAUAIhHyaAIzABXFP3EAhZgGciIgB4UiCGEjAoAlKIBMEqQiasFI%2B8qhrN2vYZMzCytbYQpuA30oACVmJEN9AnB1BFliUnIKAG0RAF0bAC5BKBKoAAFOHj4hUqh%2BImAoAH0m1CQYFtlDbmAaZgLYBhz8otragDpJ4tLpkoquEF4BWbqG5taUds7u4AH5WPiiROSELP8jU3NLaySNU49c3K9%2BqH24hNuUnPsnwpWJqa1Fb1RotNodJpdIg9PoDMAqABWRAoMD%2BY1Kk3GwkEBw%2BJ1kuKOn1SLG46iMIHAIBsdkEQA
python/typing forumhttps://discuss.python.org/c/typing/32
recently-formed Typing Councilhttps://github.com/python/typing-council#decisions
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jan 6, 2024https://github.com/python/mypy/issues/16752#issuecomment-1879549951
#16753https://github.com/python/mypy/pull/16753
https://github.com/Viicos
Viicoshttps://github.com/Viicos
on Jan 8, 2024https://github.com/python/mypy/issues/16752#issuecomment-1880575647
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jun 16, 2024https://github.com/python/mypy/issues/16752#issuecomment-2171060441
#17348https://github.com/python/mypy/pull/17348
@ilevkivskyihttps://github.com/ilevkivskyi
A5rockshttps://github.com/A5rocks
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 16, 2024https://github.com/python/mypy/issues/16752#event-13173560081
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/16752
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/16752
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
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.