René's URL Explorer Experiment


Title: False positive on `_` (underscore) as variable name with `disallow-any-expr` · Issue #15253 · python/mypy · GitHub

Open Graph Title: False positive on `_` (underscore) as variable name with `disallow-any-expr` · Issue #15253 · python/mypy

X Title: False positive on `_` (underscore) as variable name with `disallow-any-expr` · Issue #15253 · python/mypy

Description: Bug Report mypy gives a false positive with variable _ (underscore) under certain circumstances (see repro). To Reproduce https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=bca874771ec5eba30815133c9bbd4ab7 from ty...

Open Graph Description: Bug Report mypy gives a false positive with variable _ (underscore) under certain circumstances (see repro). To Reproduce https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=...

X Description: Bug Report mypy gives a false positive with variable _ (underscore) under certain circumstances (see repro). To Reproduce https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-ex...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"False positive on `_` (underscore) as variable name with `disallow-any-expr`","articleBody":"**Bug Report**\r\n\r\nmypy gives a false positive with variable `_` (underscore) under certain circumstances (see repro).\r\n\r\n**To Reproduce**\r\n\r\nhttps://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=bca874771ec5eba30815133c9bbd4ab7\r\n\r\n```python\r\nfrom typing import Callable, Tuple, TypeVar\r\n\r\nT = TypeVar(\"T\")\r\n\r\ndef wrapper(fn: Callable[[], T]) -> Tuple[T, float]:\r\n    return fn(), 1\r\n\r\ndef wrapper2(fn: Callable[[], T]) -> T:\r\n    return fn()\r\n\r\ndef func() -> int:\r\n    x = 1\r\n    return x\r\n\r\ndef a() -> None:\r\n    _, c = wrapper(func)  # \u003c- 2 errors here\r\n    b, c = wrapper(func)\r\n    _ = wrapper2(func)\r\n\r\n_, c = wrapper(func)\r\n```\r\n\r\nInterestingly only one line causes the error:\r\n- statement inside a function\r\n- variable named `_`\r\n- wrapper returns a tuple\r\n\r\n**Actual Behavior**\r\n\r\n```\r\nmain.py:16: error: Expression type contains \"Any\" (has type \"Tuple[Any, float]\")  [misc]\r\nmain.py:16: error: Expression has type \"Any\"  [misc]\r\nFound 2 errors in 1 file (checked 1 source file)\r\n```\r\n\r\n**Your Environment**\r\n\r\n(environment of the playground)\r\n\r\n- Mypy version used: 1.3.0\r\n- Mypy command-line flags: `--disallow-any-expr`\r\n- Python version used: 3.8 (same for other versions)","author":{"url":"https://github.com/lkct","@type":"Person","name":"lkct"},"datePublished":"2023-05-16T13:41:09Z","url":"https://github.com/python/mypy/issues/15253"}

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:077de240-bfa7-1d65-7168-ea95f0edafbc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8528:170A32:3EF27:569DF:6B004E5B
html-safe-nonceed6eeb5c313b27c177388e54a984e1e323485d88b218f1c28483eb2c96a0540f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTI4OjE3MEEzMjozRUYyNzo1NjlERjo2QjAwNEU1QiIsInZpc2l0b3JfaWQiOiIyMzM4NzkwMTA0NTY4NDUwNjUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaccf994f7ef7a792d9f01e3303e26a7d96fe15b0645a182dad58ed3fabd69e9ccd
hovercard-subject-tagissue:1712056103
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/15253/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c5c226d0c6fefe2371b2fc72b3ab100c6ed1bff7ef21ff658457840e01a47099/python/mypy/issues/15253
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c5c226d0c6fefe2371b2fc72b3ab100c6ed1bff7ef21ff658457840e01a47099/python/mypy/issues/15253
og:image:altBug Report mypy gives a false positive with variable _ (underscore) under certain circumstances (see repro). To Reproduce https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelkct
hostnamegithub.com
expected-hostnamegithub.com
Nonef9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b
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
releaseb27c5dde30676028abd5c5fc53ce5c9b625f8281
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/15253#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F15253
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%2F15253
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/15253
Reloadhttps://github.com/python/mypy/issues/15253
Reloadhttps://github.com/python/mypy/issues/15253
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/15253
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/15253
False positive on _ (underscore) as variable name with disallow-any-exprhttps://github.com/python/mypy/issues/15253#top
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-disallow-anyThe disallow-any-* family of flagshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-disallow-any%22
https://github.com/lkct
lkcthttps://github.com/lkct
on May 16, 2023https://github.com/python/mypy/issues/15253#issue-1712056103
https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=bca874771ec5eba30815133c9bbd4ab7https://mypy-play.net/?mypy=latest&python=3.8&flags=disallow-any-expr&gist=bca874771ec5eba30815133c9bbd4ab7
lkcthttps://github.com/lkct
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on May 16, 2023https://github.com/python/mypy/issues/15253#event-9258328896
https://github.com/AVUKU-PRAGATHESWARI
AVUKU-PRAGATHESWARIhttps://github.com/AVUKU-PRAGATHESWARI
on May 16, 2023https://github.com/python/mypy/issues/15253#issuecomment-1549957461
https://github.com/AVUKU-PRAGATHESWARI
AVUKU-PRAGATHESWARIhttps://github.com/AVUKU-PRAGATHESWARI
on May 16, 2023https://github.com/python/mypy/issues/15253#issuecomment-1549958871
https://github.com/lkct
lkcthttps://github.com/lkct
on May 16, 2023https://github.com/python/mypy/issues/15253#issuecomment-1550294674
@AVUKU-PRAGATHESWARIhttps://github.com/AVUKU-PRAGATHESWARI
https://github.com/AVUKU-PRAGATHESWARI
AVUKU-PRAGATHESWARIhttps://github.com/AVUKU-PRAGATHESWARI
on May 18, 2023https://github.com/python/mypy/issues/15253#issuecomment-1552978525
AlexWaygoodhttps://github.com/AlexWaygood
topic-disallow-anyThe disallow-any-* family of flagshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-disallow-any%22
on May 18, 2023https://github.com/python/mypy/issues/15253#event-9280802693
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on May 21, 2023https://github.com/python/mypy/issues/15253#issuecomment-1556308675
mypy/mypy/semanal.pyhttps://github.com/python/mypy/blob/2ede35fe24ad1c6c2444156c753609f6b7888064/mypy/semanal.py#L3737-L3741
2ede35fhttps://github.com/python/mypy/commit/2ede35fe24ad1c6c2444156c753609f6b7888064
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on May 21, 2023https://github.com/python/mypy/issues/15253#issuecomment-1556318376
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on May 21, 2023https://github.com/python/mypy/issues/15253#issuecomment-1556323298
@ilevkivskyihttps://github.com/ilevkivskyi
626ff689e6df171e1aec438b905efdf999bdc09ehttps://github.com/python/mypy/commit/626ff689e6df171e1aec438b905efdf999bdc09e#diff-42eda644ce5003e33ea0766d7601fcfb4934ad106429abfe115954a1fccddd07R842-R852
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jun 15, 2023https://github.com/python/mypy/issues/15253#issuecomment-1593029310
@ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 16, 2023https://github.com/python/mypy/issues/15253#issuecomment-1595406631
https://github.com/DetachHead
DetachHeadhttps://github.com/DetachHead
on Jun 20, 2023https://github.com/python/mypy/issues/15253#issuecomment-1598049222
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jun 22, 2023https://github.com/python/mypy/issues/15253#issuecomment-1603342590
#15497 (comment)https://github.com/python/mypy/pull/15497#issuecomment-1603341637
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/15253
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/15253
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
topic-disallow-anyThe disallow-any-* family of flagshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-disallow-any%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.