René's URL Explorer Experiment


Title: support pep 673 Self type · Issue #11871 · python/mypy · GitHub

Open Graph Title: support pep 673 Self type · Issue #11871 · python/mypy

X Title: support pep 673 Self type · Issue #11871 · python/mypy

Description: Feature Support the pep-673 Self type pep is at: https://www.python.org/dev/peps/pep-0673/ a rough idea of it is that this code: from typing import Self class Widget: def add_thing(self, value: str) -> Self: self.value = value return sel...

Open Graph Description: Feature Support the pep-673 Self type pep is at: https://www.python.org/dev/peps/pep-0673/ a rough idea of it is that this code: from typing import Self class Widget: def add_thing(self, value: str...

X Description: Feature Support the pep-673 Self type pep is at: https://www.python.org/dev/peps/pep-0673/ a rough idea of it is that this code: from typing import Self class Widget: def add_thing(self, value: str...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"support pep 673 Self type","articleBody":"**Feature**\r\n\r\nSupport the pep-673 Self type\r\n\r\npep is at: https://www.python.org/dev/peps/pep-0673/\r\n\r\na rough idea of it is that this code:\r\n\r\n```py\r\nfrom typing import Self\r\n\r\nclass Widget:\r\n    def add_thing(self, value: str) -> Self:\r\n        self.value = value\r\n        return self\r\n\r\n```\r\n\r\nis quasi-equivalent to:\r\n\r\n```py\r\n\r\nfrom typing import TypeVar\r\n\r\nTWidget = TypeVar(\"TWidget\", bound=\"Widget\")\r\n\r\nclass Widget:\r\n    def add_thing(self: TWidget, value: str) -> TWidget:\r\n        self.value = value\r\n        return self\r\n\r\n```\r\n\r\n**Pitch**\r\n\r\nthe appeal of the pep is that for the very common pattern of method-chained object construction, methods can easily indicate they return an object of the same type upon which the method is being invoked.  For example if I made `class SubWidget(Widget)`, the `SubWidget.add_thing()` method reports `SubWidget` as the return type automatically.   The pattern using TypeVar seems to be more or less equivlant, but is more verbose requiring the declaration of TypeVar objects per class hierarchy as well as that it has to be explicitly present on the \"self\" parameter in methods.\r\n\r\nWe are looking for this feature to make our job of integrating typing into SQLAlchemy an easier job.  it seems to be a fairly straightforward translation between two idioms.\r\n\r\n\r\ncc @caselit\r\n\r\n","author":{"url":"https://github.com/zzzeek","@type":"Person","name":"zzzeek"},"datePublished":"2021-12-29T21:28:05Z","url":"https://github.com/python/mypy/issues/11871"}

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:d7ad7066-2b3a-117f-4f12-126d4a6bbe40
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC528:22BD05:236D688:30118E7:6B002D4D
html-safe-nonce24861afa5c4c5356d2813acab2f7c37d7dc08fdf00884bfbf12b989a80393195
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTI4OjIyQkQwNToyMzZENjg4OjMwMTE4RTc6NkIwMDJENEQiLCJ2aXNpdG9yX2lkIjoiNzYyODE0MDc4NzQyMjczNTY5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9ee63669cd0340cb174823dffd0f734ef412627f6785b4dbd9d3684913be79c7
hovercard-subject-tagissue:1090757115
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/mypy/11871/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6179dd8e11b87884bbddd757347082eed8807f679b5be3edcdfc0dd13d6c652f/python/mypy/issues/11871
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6179dd8e11b87884bbddd757347082eed8807f679b5be3edcdfc0dd13d6c652f/python/mypy/issues/11871
og:image:altFeature Support the pep-673 Self type pep is at: https://www.python.org/dev/peps/pep-0673/ a rough idea of it is that this code: from typing import Self class Widget: def add_thing(self, value: str...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezzzeek
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/11871#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F11871
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%2F11871
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%2Fmypy
Reloadhttps://github.com/python/mypy/issues/11871
Reloadhttps://github.com/python/mypy/issues/11871
Reloadhttps://github.com/python/mypy/issues/11871
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests547 (547)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/11871
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/11871
#14041https://github.com/python/mypy/pull/14041
support pep 673 Self typehttps://github.com/python/mypy/issues/11871#top
#14041https://github.com/python/mypy/pull/14041
affects-typeshedAnything that blocks a typeshed changehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22affects-typeshed%22
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
metaIssues tracking a broad area of workhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22meta%22
topic-self-typesTypes for selfhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-self-types%22
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Dec 29, 2021https://github.com/python/mypy/issues/11871#issue-1090757115
https://www.python.org/dev/peps/pep-0673/https://www.python.org/dev/peps/pep-0673/
@CaselIThttps://github.com/CaselIT
zzzeekhttps://github.com/zzzeek
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
on Dec 29, 2021https://github.com/python/mypy/issues/11871#event-5826114270
https://github.com/erictraut
erictrauthttps://github.com/erictraut
on Dec 29, 2021https://github.com/python/mypy/issues/11871#issuecomment-1002807093
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Dec 30, 2021https://github.com/python/mypy/issues/11871#issuecomment-1002825193
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Dec 30, 2021https://github.com/python/mypy/issues/11871#issuecomment-1002951518
#11666https://github.com/python/mypy/pull/11666
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Dec 30, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003181631
@AlexWaygoodhttps://github.com/AlexWaygood
#11666https://github.com/python/mypy/pull/11666
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Dec 30, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003181806
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Dec 30, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003209037
@zzzeekhttps://github.com/zzzeek
@hauntsaninjahttps://github.com/hauntsaninja
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Dec 30, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003215233
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Dec 31, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003402607
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Dec 31, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003413115
situations like thishttps://stackoverflow.com/questions/68282879/type-hint-for-return-value-in-subclass/68283181#68283181
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Dec 31, 2021https://github.com/python/mypy/issues/11871#issuecomment-1003433088
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 1, 2022https://github.com/python/mypy/issues/11871#issuecomment-1003546585
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Jan 2, 2022https://github.com/python/mypy/issues/11871#issuecomment-1003732593
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jan 2, 2022https://github.com/python/mypy/issues/11871#issuecomment-1003732806
97littleleaf11https://github.com/97littleleaf11
metaIssues tracking a broad area of workhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22meta%22
on Feb 20, 2022https://github.com/python/mypy/issues/11871#event-6107664946
AlexWaygoodhttps://github.com/AlexWaygood
affects-typeshedAnything that blocks a typeshed changehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22affects-typeshed%22
topic-self-typesTypes for selfhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-self-types%22
on Apr 9, 2022https://github.com/python/mypy/issues/11871#event-6400532855
https://github.com/akrymski
akrymskihttps://github.com/akrymski
on Sep 24, 2022https://github.com/python/mypy/issues/11871#issuecomment-1257060205
https://github.com/TeamSpen210
TeamSpen210https://github.com/TeamSpen210
on Sep 25, 2022https://github.com/python/mypy/issues/11871#issuecomment-1257131014
https://github.com/jpgoldberg
jpgoldberghttps://github.com/jpgoldberg
on Nov 8, 2022https://github.com/python/mypy/issues/11871#issuecomment-1307503512
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#14041https://github.com/python/mypy/pull/14041
on Nov 15, 2022https://github.com/python/mypy/issues/11871#event-7817903413
ilevkivskyihttps://github.com/ilevkivskyi
on Nov 15, 2022https://github.com/python/mypy/issues/11871#event-7817903550
Add support for Self type (#14041)https://github.com/python/mypy/commit/77dd4b4df5b8bcd716352144feeb78862427f4dd
#14041https://github.com/python/mypy/pull/14041
https://docs.github.com/articles/closing-issues-via-commit-messages
77dd4b4https://github.com/python/mypy/commit/77dd4b4df5b8bcd716352144feeb78862427f4dd
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/11871
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/11871
affects-typeshedAnything that blocks a typeshed changehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22affects-typeshed%22
featurehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22feature%22
metaIssues tracking a broad area of workhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22meta%22
topic-self-typesTypes for selfhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-self-types%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.