René's URL Explorer Experiment


Title: Incorrect overalp detected in __rmod__ with str argument · Issue #7402 · python/mypy · GitHub

Open Graph Title: Incorrect overalp detected in __rmod__ with str argument · Issue #7402 · python/mypy

X Title: Incorrect overalp detected in __rmod__ with str argument · Issue #7402 · python/mypy

Description: Problem observed using current HEAD (0.730+dev.d2a7f05d27d9ac5c096c61ecf0455edda91f5d5a) but can confirmed on 0.660 as well, so it is nothing new. Flags used: --python-version 3.7 --strict-optional --no-site-packages --show-traceback --n...

Open Graph Description: Problem observed using current HEAD (0.730+dev.d2a7f05d27d9ac5c096c61ecf0455edda91f5d5a) but can confirmed on 0.660 as well, so it is nothing new. Flags used: --python-version 3.7 --strict-optional...

X Description: Problem observed using current HEAD (0.730+dev.d2a7f05d27d9ac5c096c61ecf0455edda91f5d5a) but can confirmed on 0.660 as well, so it is nothing new. Flags used: --python-version 3.7 --strict-optional...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect overalp detected in __rmod__ with str argument","articleBody":"Problem observed using current HEAD (0.730+dev.d2a7f05d27d9ac5c096c61ecf0455edda91f5d5a) but can confirmed on 0.660 as well, so it is nothing new.\r\n\r\nFlags used:\r\n\r\n- `--python-version 3.7 --strict-optional --no-site-packages --show-traceback --no-implicit-optional`\r\n- Also confirmed with no flags at all (Python 3.7)\r\n\r\nProblem occurs:\r\n\r\n- With `__mod__` / `__rmod__` pair.\r\n- When other in `__mod__` is `Union[T, str]`, where `T` can be self type, or some other type (let's say `int`).\r\n- When other in `__rmod__` is `str`.\r\n- When return type annotation for `__rmod__` is provided,\r\n\r\n\r\nReproducible example:\r\n\r\n```python\r\nfrom typing import Union\r\n\r\nclass Foo:\r\n    def __mod__(self, other: Union[Foo, str]) -> Foo: ...\r\n    def __rmod__(self, other: str) -> Foo: ...\r\n```\r\n\r\nyields\r\n\r\n```\r\nfoo.py:5: error: Signatures of \"__rmod__\" of \"Foo\" and \"__mod__\" of \"str\" are unsafely overlapping\r\n```\r\n\r\nIssue is specific to `__mod__` / `__rmod__` pair, i.e.  this works just fine:\r\n\r\n```python\r\nfrom typing import Union\r\n\r\nclass Foo:\r\n    def __mul__(self, other: Union[Foo, str]) -> Foo: ...\r\n    def __rmul__(self, other: str) -> Foo: ...\r\n```\r\n\r\nand I haven't found any other problematic pair.\r\n\r\nAs far as I can tell it strictly depends on `other` being `str`. For example this works just fine\r\n\r\n```python\r\nfrom typing import Union\r\n\r\nclass Foo:\r\n    def __mod__(self, other: Union[Foo, int]) -> Foo: ...\r\n    def __rmod__(self, other: int) -> Foo: ...\r\n```\r\n\r\nAdditionally, to reproduce the problem, we need a return type annotation on `__rmod__`, and removing it is sufficient to pass type check (removing return type annotation from `__mod__` has no impact at all):\r\n\r\n```python\r\nfrom typing import Union\r\n \r\nclass Foo:\r\n    def __mod__(self, other: Union[Foo, str]) -> Foo: ...          \r\n    def __rmod__(self, other: str): ...          \r\n```\r\n\r\nthough failure is not specifically caused by referencing self type, as for example this, will fail as well\r\n\r\n```python\r\nfrom typing import Union\r\n \r\nclass Foo:\r\n    def __mod__(self, other: Union[Foo, str]) -> int: ...   \r\n    def __rmod__(self, other: str) -> int: ...   \r\n```\r\n\r\n```\r\nfoo.py:5: error: Signatures of \"__rmod__\" of \"Foo\" and \"__mod__\" of \"str\" are unsafely overlapping\r\n```\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/zero323","@type":"Person","name":"zero323"},"datePublished":"2019-08-28T19:10:12Z","url":"https://github.com/python/mypy/issues/7402"}

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:72f69d9c-0936-d5d6-33a2-6e5f4d651066
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id982A:2C0A92:2E6A4B0:3D22F0B:6B00200F
html-safe-nonce098fc799e5832b76d3ba4649c8c2730ca1a8241b9138c7748d183cba7ee022bd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODJBOjJDMEE5MjoyRTZBNEIwOjNEMjJGMEI6NkIwMDIwMEYiLCJ2aXNpdG9yX2lkIjoiMjMzNzY1ODEwNTgwODAzNTg1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7a427ea0c96399d8ea8a7ee4b7c6069c77921280f5751b6cc9fd20a475d3a9cd
hovercard-subject-tagissue:486559114
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/7402/issue_layout
twitter:imagehttps://opengraph.githubassets.com/49b657d6053e2e4cb5612bc843eeea2d5bb689cbfd2a28792abf5204a6a613e2/python/mypy/issues/7402
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/49b657d6053e2e4cb5612bc843eeea2d5bb689cbfd2a28792abf5204a6a613e2/python/mypy/issues/7402
og:image:altProblem observed using current HEAD (0.730+dev.d2a7f05d27d9ac5c096c61ecf0455edda91f5d5a) but can confirmed on 0.660 as well, so it is nothing new. Flags used: --python-version 3.7 --strict-optional...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezero323
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/7402#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F7402
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%2F7402
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/7402
Reloadhttps://github.com/python/mypy/issues/7402
Reloadhttps://github.com/python/mypy/issues/7402
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 requests546 (546)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/7402
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/7402
Incorrect overalp detected in __rmod__ with str argumenthttps://github.com/python/mypy/issues/7402#top
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
topic-usabilityhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-usability%22
https://github.com/zero323
zero323https://github.com/zero323
on Aug 28, 2019https://github.com/python/mypy/issues/7402#issue-486559114
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Aug 28, 2019https://github.com/python/mypy/issues/7402#issuecomment-525934133
that accepts anything for the RHShttps://github.com/python/typeshed/blob/master/stdlib/2and3/builtins.pyi#L535
which only accept other intshttps://github.com/python/typeshed/blob/master/stdlib/2and3/builtins.pyi#L160
into an overloadhttps://github.com/python/mypy/blob/d2a7f05d27d9ac5c096c61ecf0455edda91f5d5a/mypy/checker.py#L1193
https://github.com/zero323
zero323https://github.com/zero323
on Aug 29, 2019https://github.com/python/mypy/issues/7402#issuecomment-526077481
@Michael0x2ahttps://github.com/Michael0x2a
JukkaLhttps://github.com/JukkaL
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
topic-usabilityhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-usability%22
on Aug 29, 2019https://github.com/python/mypy/issues/7402#event-2594179450
https://github.com/tapaswenipathak
tapaswenipathakhttps://github.com/tapaswenipathak
on Sep 3, 2019https://github.com/python/mypy/issues/7402#issuecomment-527335698
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Sep 4, 2019https://github.com/python/mypy/issues/7402#issuecomment-527961461
@tapaswenipathakhttps://github.com/tapaswenipathak
check_overlapping_op_methods in checker.pyhttps://github.com/python/mypy/blob/master/mypy/checker.py#L1194
overload_can_never_matchhttps://github.com/python/mypy/blob/master/mypy/checker.py#L4438
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jun 27, 2024https://github.com/python/mypy/issues/7402#issuecomment-2192918103
#17392https://github.com/python/mypy/pull/17392
JukkaLhttps://github.com/JukkaL
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 28, 2024https://github.com/python/mypy/issues/7402#event-13331293019
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/7402
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/7402
priority-1-normalhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-1-normal%22
topic-usabilityhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-usability%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.