René's URL Explorer Experiment


Title: Tracking issue for overloads · Issue #5119 · python/mypy · GitHub

Open Graph Title: Tracking issue for overloads · Issue #5119 · python/mypy

X Title: Tracking issue for overloads · Issue #5119 · python/mypy

Description: This is an issue summarizing all remaining TODOs for the overloads overhaul. Done Add support for detecting partially-overlapping arities. For example, disallow f(A, A) -> int and f(*A) -> str. This will likely require modifications to i...

Open Graph Description: This is an issue summarizing all remaining TODOs for the overloads overhaul. Done Add support for detecting partially-overlapping arities. For example, disallow f(A, A) -> int and f(*A) -> str. Thi...

X Description: This is an issue summarizing all remaining TODOs for the overloads overhaul. Done Add support for detecting partially-overlapping arities. For example, disallow f(A, A) -> int and f(*A) -> st...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tracking issue for overloads","articleBody":"This is an issue summarizing all remaining TODOs for the overloads overhaul.\r\n\r\n## Done\r\n\r\n- [x] Add support for detecting partially-overlapping arities. \r\n\r\n    For example, disallow `f(A, A) -> int` and `f(*A) -> str`. This will likely require modifications to `is_callable_compatible` (or require implementing a new, similar method).\r\n\r\n- [x] Improve union math semantics. Related issues:\r\n\r\n    - [Support basic union math for overloaded functions](https://github.com/python/mypy/issues/4576)\r\n    - [One more bug with union math logic](https://github.com/python/mypy/issues/5243)\r\n    - [Wrong overload resolution with Any union item in argument](https://github.com/python/mypy/issues/5249) (?)\r\n\r\n- [x] Update docs to clarify what the new overload semantics are. Related issues:\r\n\r\n    - [Docs for function overloading are made more complex by using __getitem__ as example](https://github.com/python/mypy/issues/4579)\r\n\r\n- [x] Improving how overload implementations are checked. Related issues:\r\n\r\n    - [Errors when using overloaded functions and type variables](https://github.com/python/mypy/issues/4619)\r\n\r\n- [x] Add full support for partially-overlapping types.\r\n\r\n    For example, disallow `f(Union[A, B]) -> int` and `f(Union[B, C]) -> str`. We currently support detect partially-overlapping unions and tuples on just the top-level.\r\n\r\n    Related issues:\r\n\r\n    - [Allow overloading based on TypedDict structure](https://github.com/python/mypy/issues/3618)\r\n    - [Overloaded function signatures 1 and 2 overlap with incompatible return types](https://github.com/python/mypy/issues/4020)\r\n    - [Allow overloads to be distinguished by contained type of a generic](https://github.com/python/mypy/issues/4159)\r\n    - [spurious \"Need type annotation\" error with overloads](https://github.com/python/mypy/issues/4227)\r\n\r\n    Sub-todos:\r\n\r\n    - [x] If all arguments in the first overload are partially overlapping with the second, report an error (even if the first return type is narrower).\r\n\r\n        We should also probably have a custom error message, since this is technically safe when the first return type is narrower. This should also probably wait until we have more robust support for partially-overlapping types.\r\n\r\n        **Edit**: We decided it wasn't worth complicating the code to handle this TODO.\r\n\r\n## In-progress\r\n\r\n- [x] Add union math for operators. See https://github.com/python/mypy/issues/2128.\r\n\r\n- [ ] Error messages need a usability overhaul. Related open issues:\r\n\r\n    - [Give better error messages when calling overloaded function with invalid types](https://github.com/python/mypy/issues/672)\r\n    - [Ordering matters for @overload](https://github.com/python/mypy/issues/1270) (error message could be improved)\r\n    - [More specific overlapping overload errors](https://github.com/python/mypy/issues/3819)\r\n    - [Handling de-facto positional-only arguments with overloads](https://github.com/python/mypy/issues/5235)\r\n\r\n## Remaining todos:\r\n\r\n- [ ] Overload subtypes could be enhanced to use the new union math algorithms in some way. Related open issues:\r\n\r\n    - [Type inference problems with unions, overloads and map](https://github.com/python/mypy/issues/390)\r\n    - [Overloaded function as a subtype of function with union types args/return](https://github.com/python/mypy/issues/495)\r\n\r\n- [ ] Improve test coverage:\r\n\r\n    Sub-TODOs:\r\n\r\n    - [ ] Add test cases for situations where the overload definitions have a type error (that may or may not have been type-ignored).\r\n\r\n- [ ] Update PEP 484/submit a new mini-PEP or something.\r\n\r\n## Remaining todos; deprioritized\r\n\r\n- [ ] Re-think how overloads, operator overloading, and overload subtyping interacts. Related open issues:\r\n\r\n    - [Make operator overloading overlapping checks more lenient](https://github.com/python/mypy/issues/1264)\r\n    - [Ordering matters for @overload](https://github.com/python/mypy/issues/1270) (one of the error messages seems like a bug)\r\n    - [Overloading function issues (incompatible with supertype). ](https://github.com/python/mypy/issues/3750)\r\n    - [Signatures of overloaded operators are incompatible with super type](https://github.com/python/mypy/issues/4985)\r\n\r\n    Sub-TODOs:\r\n\r\n    - [x] Update code for operator methods to take advantages of the overload refactorings. \r\n\r\n        For example, I think operator methods currently might be ignoring generics when checking for overlaps (though it's unclear if this is actually an issue in real-life code). This mostly boils down to using `is_callable_compatible` in clever ways within `is_unsafe_overlapping_operator_signatures` and adding more tests.\r\n\r\n- [ ] Enhance binder to understand how overloads and NoReturn interact. Related issues:\r\n\r\n    - [Narrow types using overload information](https://github.com/python/mypy/issues/4063)\r\n\r\n- [ ] General refactoring and cleanup:\r\n\r\n    - [ ] Adjust the semantic analysis phase so we use the same binding for a typevar across all overload alternatives. \r\n\r\n        This would let us remove `merge_typevars_in_callables_by_name`. Implementing this would probably require refactoring `TypeVarScope`?\r\n\r\n- [ ] Improving how overloads and decorators interact. Related issues:\r\n\r\n    - [Running mypy with --disallow-untyped-decorators reports an error for overloaded decorators](https://github.com/python/mypy/issues/4191)\r\n\r\n## Issues that need triaging\r\n\r\n- [ ] [Optional strict checking of overloads](https://github.com/python/mypy/issues/4333)\r\n- [ ] [Refactor operator method access and protocol checks to use checkmember.py](https://github.com/python/mypy/issues/5136)","author":{"url":"https://github.com/Michael0x2a","@type":"Person","name":"Michael0x2a"},"datePublished":"2018-05-29T07:13:19Z","url":"https://github.com/python/mypy/issues/5119"}

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:55912969-60f0-0051-9753-2bd73184e86d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCB1E:BACA4:2E48B2F:3D47A86:6B0028A3
html-safe-nonce7969f090b739c33c3f0e6e78fb278209969aa72902d417944d491b945f37c8fa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjFFOkJBQ0E0OjJFNDhCMkY6M0Q0N0E4Njo2QjAwMjhBMyIsInZpc2l0b3JfaWQiOiIyOTgyNTI0MzA4MzEzNjE0NDk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbd3dc95145fc76fbe912257888a7863cd7026772a7af156222e3039553d08c95
hovercard-subject-tagissue:327195443
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/5119/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fe4d6b47aad26e058e37579ff9d4106b80a4d352f9c2b9c09fc974638d8b324f/python/mypy/issues/5119
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fe4d6b47aad26e058e37579ff9d4106b80a4d352f9c2b9c09fc974638d8b324f/python/mypy/issues/5119
og:image:altThis is an issue summarizing all remaining TODOs for the overloads overhaul. Done Add support for detecting partially-overlapping arities. For example, disallow f(A, A) -> int and f(*A) -> str. Thi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMichael0x2a
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/5119#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F5119
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%2F5119
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/5119
Reloadhttps://github.com/python/mypy/issues/5119
Reloadhttps://github.com/python/mypy/issues/5119
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/5119
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/5119
Tracking issue for overloadshttps://github.com/python/mypy/issues/5119#top
https://github.com/Michael0x2a
metaIssues tracking a broad area of workhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22meta%22
topic-overloadshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-overloads%22
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on May 29, 2018https://github.com/python/mypy/issues/5119#issue-327195443
Support basic union math for overloaded functionshttps://github.com/python/mypy/issues/4576
One more bug with union math logichttps://github.com/python/mypy/issues/5243
Wrong overload resolution with Any union item in argumenthttps://github.com/python/mypy/issues/5249
Docs for function overloading are made more complex by using getitem as examplehttps://github.com/python/mypy/issues/4579
Errors when using overloaded functions and type variableshttps://github.com/python/mypy/issues/4619
Allow overloading based on TypedDict structurehttps://github.com/python/mypy/issues/3618
Overloaded function signatures 1 and 2 overlap with incompatible return typeshttps://github.com/python/mypy/issues/4020
Allow overloads to be distinguished by contained type of a generichttps://github.com/python/mypy/issues/4159
spurious "Need type annotation" error with overloadshttps://github.com/python/mypy/issues/4227
Mypy fails on Union[float, int] + Union[float, int] #2128https://github.com/python/mypy/issues/2128
Give better error messages when calling overloaded function with invalid typeshttps://github.com/python/mypy/issues/672
Ordering matters for @overloadhttps://github.com/python/mypy/issues/1270
More specific overlapping overload errorshttps://github.com/python/mypy/issues/3819
Handling de-facto positional-only arguments with overloadshttps://github.com/python/mypy/issues/5235
Type inference problems with unions, overloads and maphttps://github.com/python/mypy/issues/390
Overloaded function as a subtype of function with union types args/returnhttps://github.com/python/mypy/issues/495
Make operator overloading overlapping checks more lenienthttps://github.com/python/mypy/issues/1264
Ordering matters for @overloadhttps://github.com/python/mypy/issues/1270
Overloading function issues (incompatible with supertype). https://github.com/python/mypy/issues/3750
Signatures of overloaded operators are incompatible with super typehttps://github.com/python/mypy/issues/4985
Narrow types using overload informationhttps://github.com/python/mypy/issues/4063
Running mypy with --disallow-untyped-decorators reports an error for overloaded decoratorshttps://github.com/python/mypy/issues/4191
Optional strict checking of overloadshttps://github.com/python/mypy/issues/4333
Refactor operator method access and protocol checks to use checkmember.pyhttps://github.com/python/mypy/issues/5136
Michael0x2ahttps://github.com/Michael0x2a
topic-overloadshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-overloads%22
on May 29, 2018https://github.com/python/mypy/issues/5119#event-1650351199
Michael0x2ahttps://github.com/Michael0x2a
on May 29, 2018https://github.com/python/mypy/issues/5119#event-1650351204
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on May 30, 2018https://github.com/python/mypy/issues/5119#issuecomment-393221830
@Michael0x2ahttps://github.com/Michael0x2a
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on May 30, 2018https://github.com/python/mypy/issues/5119#issuecomment-393255597
@ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on May 30, 2018https://github.com/python/mypy/issues/5119#issuecomment-393348742
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 2, 2018https://github.com/python/mypy/issues/5119#issuecomment-394117178
@Michael0x2ahttps://github.com/Michael0x2a
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Jun 2, 2018https://github.com/python/mypy/issues/5119#issuecomment-394121590
@ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 2, 2018https://github.com/python/mypy/issues/5119#issuecomment-394122016
Michael0x2ahttps://github.com/Michael0x2a
on Jun 6, 2018https://github.com/python/mypy/issues/5119#event-1667209491
Add support for detecting overloads with overlapping aritieshttps://github.com/Michael0x2a/mypy/commit/1cdbc53b9ec40dd65233f76bd087b3e8e086a1e9
1cdbc53https://github.com/Michael0x2a/mypy/commit/1cdbc53b9ec40dd65233f76bd087b3e8e086a1e9
Michael0x2ahttps://github.com/Michael0x2a
on Jun 16, 2018https://github.com/python/mypy/issues/5119#event-1684468471
Add support for detecting overloads with overlapping arities (#5163)https://github.com/python/mypy/commit/4fe222080cb0c0648fcdf00df23bfe765e1cfca6
#5163https://github.com/python/mypy/pull/5163
4fe2220https://github.com/python/mypy/commit/4fe222080cb0c0648fcdf00df23bfe765e1cfca6
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 18, 2018https://github.com/python/mypy/issues/5119#issuecomment-398001535
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 22, 2018https://github.com/python/mypy/issues/5119#issuecomment-399401282
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Jun 22, 2018https://github.com/python/mypy/issues/5119#issuecomment-399450659
@ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 23, 2018https://github.com/python/mypy/issues/5119#issuecomment-399615274
97littleleaf11https://github.com/97littleleaf11
metaIssues tracking a broad area of workhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22meta%22
on Nov 12, 2021https://github.com/python/mypy/issues/5119#event-5608450120
https://github.com/ichard26
ichard26https://github.com/ichard26
on Aug 22, 2023https://github.com/python/mypy/issues/5119#issuecomment-1687238121
@Michael0x2ahttps://github.com/Michael0x2a
ichard26https://github.com/ichard26
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 22, 2023https://github.com/python/mypy/issues/5119#event-10151795466
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/5119
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/5119
Michael0x2ahttps://github.com/Michael0x2a
metaIssues tracking a broad area of workhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22meta%22
topic-overloadshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-overloads%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.