René's URL Explorer Experiment


Title: Clarify what @overload means · Issue #253 · python/typing · GitHub

Open Graph Title: Clarify what @overload means · Issue #253 · python/typing

X Title: Clarify what @overload means · Issue #253 · python/typing

Description: In mypy (at least) overlapping @overload variants are not an error as long as the return types match. Examples where this has been reported or discussed include: python/mypy#1941 python/mypy#1879 python/mypy#1612 python/mypy#1541 python/...

Open Graph Description: In mypy (at least) overlapping @overload variants are not an error as long as the return types match. Examples where this has been reported or discussed include: python/mypy#1941 python/mypy#1879 p...

X Description: In mypy (at least) overlapping @overload variants are not an error as long as the return types match. Examples where this has been reported or discussed include: python/mypy#1941 python/mypy#1879 p...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Clarify what @overload means","articleBody":"In mypy (at least) overlapping `@overload` variants are not an error as long as the return types match. Examples where this has been reported or discussed include:\n- https://github.com/python/mypy/issues/1941\n- https://github.com/python/mypy/issues/1879\n- https://github.com/python/mypy/issues/1612\n- https://github.com/python/mypy/issues/1541\n- https://github.com/python/mypy/issues/1322\n- https://github.com/python/mypy/issues/1270\n- https://github.com/python/mypy/issues/1264\n\nThere are probably more, but the point should be clear. We should either decide that overloads are tried in order of occurrence until a match is found, or that mypy's current philosophy is correct. Once we have decided we should update PEP 484 to clarify the desired behavior and explain the motivation. (And fix mypy, if needed.)\n\nI'm not sure that it's always possible to have one unique match; e.g. in https://github.com/python/mypy/issues/1322 the problem is that we're calling `f(*some_list)` and this is deemed a match for both variants. Mypy then cannot deduce a precise return type and falls back to Any.\n\nI could also imagine that unions or type variables could make it hard to unambiguously pick a variant.\n\nI'd also like to point out that the algorithm chosen by a type checker doesn't have to be the same as that chosen at run time -- at run time the overload variants are irrelevant and a single implementation does all the work using e.g. `*args` and isinstance() (or maybe using functools.singledispatch). But mypy's approach to overlapping is clearly causing a lot of confusion and it would be good to discuss this and write up in the PEP what a type checker _should_ do.\n\n@JukkaL, anything else we should consider here? Do you have a preference?\n\n@matthiaskramm, is this relevant to pytype?\n\n@vlasovskikh, any feedback from the PyCharm team?\n","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2016-07-26T15:29:42Z","url":"https://github.com/python/typing/issues/253"}

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:bd2f91da-863f-af3a-89ee-92d17a7ea4ed
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9BF0:CF959:25A552E:30F6879:6AFFF0F4
html-safe-nonce81dea152719d5fad75aeb01c02f6772d490d5c4c1850838658d484f72e661e5d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkYwOkNGOTU5OjI1QTU1MkU6MzBGNjg3OTo2QUZGRjBGNCIsInZpc2l0b3JfaWQiOiI1MzI1NTgyMDUzODAwOTMxNTcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacccddcf9ab0df0de0a5b3e75e2bd195d367bd52c564376b8c50f7a67cfe4fe47b
hovercard-subject-tagissue:167637295
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/253/issue_layout
twitter:imagehttps://opengraph.githubassets.com/16b75b22bbdb44772631de5cb9a2e8acffa51b9e92ecd844f48c71684284a83f/python/typing/issues/253
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/16b75b22bbdb44772631de5cb9a2e8acffa51b9e92ecd844f48c71684284a83f/python/typing/issues/253
og:image:altIn mypy (at least) overlapping @overload variants are not an error as long as the return types match. Examples where this has been reported or discussed include: python/mypy#1941 python/mypy#1879 p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegvanrossum
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typing/issues/253#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftyping%2Fissues%2F253
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%2F253
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/253
Reloadhttps://github.com/python/typing/issues/253
Reloadhttps://github.com/python/typing/issues/253
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/253
New issuehttps://github.com/login?return_to=https://github.com/python/typing/issues/253
Clarify what @overload meanshttps://github.com/python/typing/issues/253#top
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
PEP 484 finalizationhttps://github.com/python/typing/milestone/4
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Jul 26, 2016https://github.com/python/typing/issues/253#issue-167637295
Overloaded function signatures overlap with incompatible return types, class and Callable mypy#1941https://github.com/python/mypy/issues/1941
No error for identical overloaded functions mypy#1879https://github.com/python/mypy/issues/1879
Overloads with identical signatures not an error mypy#1612https://github.com/python/mypy/issues/1612
Type inference problem with overloaded mkdtemp mypy#1541https://github.com/python/mypy/issues/1541
Any incorrectly inferred for a call to an overloaded function mypy#1322https://github.com/python/mypy/issues/1322
Ordering matters for @overload mypy#1270https://github.com/python/mypy/issues/1270
Make operator overloading overlapping checks more lenient mypy#1264https://github.com/python/mypy/issues/1264
python/mypy#1322https://github.com/python/mypy/issues/1322
@JukkaLhttps://github.com/JukkaL
@matthiaskrammhttps://github.com/matthiaskramm
@vlasovskikhhttps://github.com/vlasovskikh
Nexthttps://github.com/python/typing/issues/253?timeline_page=1
gvanrossumhttps://github.com/gvanrossum
enhancementhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22enhancement%22
help wantedhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
questionhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22question%22
on Jul 26, 2016https://github.com/python/typing/issues/253#event-735145987
https://github.com/vlasovskikh
vlasovskikhhttps://github.com/vlasovskikh
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235311955
https://github.com/matthiaskramm
matthiaskrammhttps://github.com/matthiaskramm
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235312313
https://github.com/matthiaskramm
matthiaskrammhttps://github.com/matthiaskramm
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235313062
python/typeshed#270https://github.com/python/typeshed/issues/270
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235321518
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235358145
python/mypy#1941 (comment)https://github.com/python/mypy/issues/1941#issuecomment-235357559
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235358878
https://github.com/matthiaskramm
matthiaskrammhttps://github.com/matthiaskramm
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235362660
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Jul 26, 2016https://github.com/python/typing/issues/253#issuecomment-235375897
https://github.com/matthiaskramm
matthiaskrammhttps://github.com/matthiaskramm
on Jul 27, 2016https://github.com/python/typing/issues/253#issuecomment-235452447
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
on Jul 27, 2016https://github.com/python/typing/issues/253#issuecomment-235537157
https://github.com/matthiaskramm
matthiaskrammhttps://github.com/matthiaskramm
on Jul 27, 2016https://github.com/python/typing/issues/253#issuecomment-235652393
https://github.com/dmoisset
dmoissethttps://github.com/dmoisset
on Aug 25, 2016https://github.com/python/typing/issues/253#issuecomment-242421895
Michael0x2ahttps://github.com/Michael0x2a
on May 19, 2018https://github.com/python/typing/issues/253#event-1635346401
Overhaul overload semantics, remove erasure, add union mathhttps://github.com/Michael0x2a/mypy/commit/220c3a18021fc3e55301796b30029c699f51f3c7
220c3a1https://github.com/Michael0x2a/mypy/commit/220c3a18021fc3e55301796b30029c699f51f3c7
gwkhttps://github.com/gwk
on May 29, 2018https://github.com/python/typing/issues/253#event-1650114090
Ensures overloads are ordered from narrow to broad (python#2138)https://github.com/gwk/typeshed/commit/a41030faf0f5e0dd91f6f54f2fb3bdea875adf50
python#2138https://github.com/python/typeshed/pull/2138
a41030fhttps://github.com/gwk/typeshed/commit/a41030faf0f5e0dd91f6f54f2fb3bdea875adf50
facebook-github-bothttps://github.com/facebook-github-bot
on Oct 25, 2018https://github.com/python/typing/issues/253#event-1925069925
Differentiate overload stubs and implementationshttps://github.com/meta/pyre-check/commit/27250cedbbb2a580ed4200162673c509b3c84828
27250cehttps://github.com/meta/pyre-check/commit/27250cedbbb2a580ed4200162673c509b3c84828
yedpodtrzitkohttps://github.com/yedpodtrzitko
on Jan 23, 2019https://github.com/python/typing/issues/253#event-2090660789
Ensures overloads are ordered from narrow to broad (python#2138)https://github.com/yedpodtrzitko/typeshed/commit/006397f857da4b189c68615bb2e2827bbf2a911b
python#2138https://github.com/python/typeshed/pull/2138
006397fhttps://github.com/yedpodtrzitko/typeshed/commit/006397f857da4b189c68615bb2e2827bbf2a911b
https://github.com/saulshanabrook
saulshanabrookhttps://github.com/saulshanabrook
on Feb 11, 2019https://github.com/python/typing/issues/253#issuecomment-462199996
@Michael0x2ahttps://github.com/Michael0x2a
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Feb 11, 2019https://github.com/python/typing/issues/253#issuecomment-462255406
facebook-github-bothttps://github.com/facebook-github-bot
on Apr 3, 2019https://github.com/python/typing/issues/253#event-2251253720
Prefer first overloadhttps://github.com/meta/pyre-check/commit/6432d6e00d5c6692de4f99e5f7ce30dc4ba45653
6432d6ehttps://github.com/meta/pyre-check/commit/6432d6e00d5c6692de4f99e5f7ce30dc4ba45653
srittauhttps://github.com/srittau
help wantedhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22help%20wanted%22
on Nov 4, 2021https://github.com/python/typing/issues/253#event-5567088976
https://github.com/srittau
srittauhttps://github.com/srittau
on Nov 4, 2021https://github.com/python/typing/issues/253#issuecomment-960610527
srittauhttps://github.com/srittau
completedhttps://github.com/python/typing/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 4, 2021https://github.com/python/typing/issues/253#event-5567271245
srittauhttps://github.com/srittau
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
questionhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22question%22
enhancementhttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Nov 4, 2021https://github.com/python/typing/issues/253#event-5567272433
https://github.com/jace
jacehttps://github.com/jace
on Sep 7, 2022https://github.com/python/typing/issues/253#issuecomment-1239888618
@Michael0x2ahttps://github.com/Michael0x2a
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 7, 2022https://github.com/python/typing/issues/253#issuecomment-1239923861
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typing/issues/253
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typing/issues/253
topic: featureDiscussions about new features for Python's type annotationshttps://github.com/python/typing/issues?q=state%3Aopen%20label%3A%22topic%3A%20feature%22
PEP 484 finalizationhttps://github.com/python/typing/milestone/4
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.