René's URL Explorer Experiment


Title: strict_optional=False makes checking scripts using xarray to fail · Issue #9437 · python/mypy · GitHub

Open Graph Title: strict_optional=False makes checking scripts using xarray to fail · Issue #9437 · python/mypy

X Title: strict_optional=False makes checking scripts using xarray to fail · Issue #9437 · python/mypy

Description: 🐛 Bug Report When using mypy with strict_optional = False in the config file or using the --no-strict-optional flag in the terminal to check a file using the xarray package, it fails with an scary INTERNAL ERROR message. This might be a ...

Open Graph Description: 🐛 Bug Report When using mypy with strict_optional = False in the config file or using the --no-strict-optional flag in the terminal to check a file using the xarray package, it fails with an scary ...

X Description: 🐛 Bug Report When using mypy with strict_optional = False in the config file or using the --no-strict-optional flag in the terminal to check a file using the xarray package, it fails with an scary ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"strict_optional=False makes checking scripts using xarray to fail","articleBody":"## 🐛 Bug Report\r\n\r\nWhen using mypy with `strict_optional = False` in the config file or using the `--no-strict-optional` flag in the terminal to check a file using the `xarray` package, it fails with an scary INTERNAL ERROR message.\r\n\r\nThis might be a bug better suited for the `xarray` team, but thought to check with you first.\r\n\r\n## To Reproduce\r\n\r\nWrite a python script just importing `xarray`:\r\n\r\n```python\r\nimport xarray as xr\r\n```\r\n\r\nAnd check it with mypy using `mypy --no-strict-optional script.py`\r\n\r\n## Expected Behavior\r\n\r\nEverything works fine and I get: `Success: no issues found in 1 source file` . This is indeed the behavior if the `--no-strict-optional` flag is NOT used.\r\n\r\n## Actual Behavior\r\n\r\nI get the following output (personal info replaced by XXXXX):\r\n\r\n```\r\n/XXXXX/venv/lib/python3.7/site-packages/xarray/core/dataarray.py:2001: error: INTERNAL ERROR -- Please try using mypy master on Github:\r\nhttps://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build\r\nIf this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues\r\nversion: 0.782\r\n/XXXXX/venv/lib/python3.7/site-packages/xarray/core/dataarray.py:2001: : note: please use --show-traceback to print a traceback when reporting a bug\r\n```\r\n\r\nI've tried also the development version of mypy, as sugested, with identical results, and also used the `--show-traceback` option, with results in:\r\n\r\n```\r\n/XXXXX/venv/lib/python3.7/site-packages/xarray/core/dataarray.py:2001: error: INTERNAL ERROR -- Please try using mypy master on Github:\r\nhttps://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 0.782\r\nTraceback (most recent call last):\r\n  File \"mypy/checker.py\", line 401, in accept\r\n  File \"mypy/nodes.py\", line 1129, in accept\r\n  File \"mypy/checker.py\", line 3437, in visit_for_stmt\r\n  File \"mypy/checker.py\", line 3470, in analyze_iterable_item_type\r\n  File \"mypy/checkexpr.py\", line 2345, in check_method_call_by_name\r\n  File \"mypy/checkmember.py\", line 126, in analyze_member_access\r\n  File \"mypy/checkmember.py\", line 143, in _analyze_member_access\r\n  File \"mypy/checkmember.py\", line 225, in analyze_instance_member_access\r\n  File \"mypy/checkmember.py\", line 376, in analyze_member_var_access\r\n  File \"mypy/checkmember.py\", line 578, in analyze_var\r\n  File \"mypy/meet.py\", line 50, in meet_types\r\n  File \"mypy/types.py\", line 794, in accept\r\n  File \"mypy/meet.py\", line 497, in visit_instance\r\n  File \"mypy/meet.py\", line 647, in meet\r\n  File \"mypy/meet.py\", line 50, in meet_types\r\n  File \"mypy/types.py\", line 1347, in accept\r\n  File \"mypy/meet.py\", line 584, in visit_tuple_type\r\n  File \"mypy/typeops.py\", line 44, in tuple_fallback\r\n  File \"mypy/join.py\", line 531, in join_type_list\r\n  File \"mypy/join.py\", line 105, in join_types\r\n  File \"mypy/types.py\", line 794, in accept\r\n  File \"mypy/join.py\", line 158, in visit_instance\r\n  File \"mypy/join.py\", line 371, in join_instances\r\n  File \"mypy/subtypes.py\", line 143, in is_subtype_ignoring_tvars\r\n  File \"mypy/subtypes.py\", line 93, in is_subtype\r\n  File \"mypy/subtypes.py\", line 135, in _is_subtype\r\n  File \"mypy/types.py\", line 794, in accept\r\n  File \"mypy/subtypes.py\", line 259, in visit_instance\r\n  File \"mypy/subtypes.py\", line 541, in is_protocol_implementation\r\n  File \"mypy/subtypes.py\", line 93, in is_subtype\r\n  File \"mypy/subtypes.py\", line 135, in _is_subtype\r\n  File \"mypy/types.py\", line 1786, in accept\r\n  File \"mypy/subtypes.py\", line 459, in visit_partial_type\r\nRuntimeError: \r\n/XXXXX/venv/lib/python3.7/site-packages/xarray/core/dataarray.py:2001: : note: use --pdb to drop into pdb\r\n```\r\n\r\n## Your Environment\r\n\r\n- Mypy version used: 0.782\r\n- xarray version: 0.16.0\r\n- Mypy command-line flags: `--no-strict-optional`\r\n- Mypy configuration options from `mypy.ini` (and other config files):  `strict_optional = False` has the same effect.\r\n- Python version used:  3.7.4\r\n- Operating system and version: Mac OS Catalina 10.15.6","author":{"url":"https://github.com/dalonsoa","@type":"Person","name":"dalonsoa"},"datePublished":"2020-09-11T08:15:45Z","url":"https://github.com/python/mypy/issues/9437"}

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:567bd813-f4ba-3678-42d3-7a467bab2fea
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD138:07D0:1B4436E:240E19F:6B003838
html-safe-nonce79cb7450bd1c5e7afbc907f5bdeab1044c1fe22dedfe12ca159436031c424a66
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTM4OjA3RDA6MUI0NDM2RToyNDBFMTlGOjZCMDAzODM4IiwidmlzaXRvcl9pZCI6IjU0NzcxOTM3NTUxMDQ2NTU0MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfe026f8ac2a9548e4cbe240782f30462ad58557504ad31621336c4acb9967f69
hovercard-subject-tagissue:699005330
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/9437/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d79544c5dfcfc365a3eff986b46c0867fcd7db8dce94001eed84d24a75572a55/python/mypy/issues/9437
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d79544c5dfcfc365a3eff986b46c0867fcd7db8dce94001eed84d24a75572a55/python/mypy/issues/9437
og:image:alt🐛 Bug Report When using mypy with strict_optional = False in the config file or using the --no-strict-optional flag in the terminal to check a file using the xarray package, it fails with an scary ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedalonsoa
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/9437#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F9437
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%2F9437
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/9437
Reloadhttps://github.com/python/mypy/issues/9437
Reloadhttps://github.com/python/mypy/issues/9437
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 requests545 (545)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/9437
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/9437
strict_optional=False makes checking scripts using xarray to failhttps://github.com/python/mypy/issues/9437#top
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
https://github.com/dalonsoa
dalonsoahttps://github.com/dalonsoa
on Sep 11, 2020https://github.com/python/mypy/issues/9437#issue-699005330
dalonsoahttps://github.com/dalonsoa
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Sep 11, 2020https://github.com/python/mypy/issues/9437#event-3754943421
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 11, 2020https://github.com/python/mypy/issues/9437#issuecomment-691194366
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 27, 2020https://github.com/python/mypy/issues/9437#issuecomment-699641749
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 27, 2020https://github.com/python/mypy/issues/9437#issuecomment-699698971
#6442https://github.com/python/mypy/pull/6442
gvanrossumhttps://github.com/gvanrossum
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Sep 28, 2020https://github.com/python/mypy/issues/9437#event-3812138399
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699713290
#6442https://github.com/python/mypy/pull/6442
https://github.com/pydata/xarray/blob/ed1b865688b2437a434dbf5bd5e602ad714453db/xarray/core/dataarray.py#L2040https://github.com/pydata/xarray/blob/ed1b865688b2437a434dbf5bd5e602ad714453db/xarray/core/dataarray.py#L2040
mypy/mypy/subtypes.pyhttps://github.com/python/mypy/blob/4fb5a21b443c1fe593d0e2d1cf063811efea4902/mypy/subtypes.py#L466-L468
4fb5a21https://github.com/python/mypy/commit/4fb5a21b443c1fe593d0e2d1cf063811efea4902
#6442https://github.com/python/mypy/pull/6442
fc72019https://github.com/python/mypy/commit/fc72019ea8f40251e57d02edb48b2b5b4401ae91
https://github.com/pydata/xarray/blob/ed1b865688b2437a434dbf5bd5e602ad714453db/xarray/core/dataarray.py#L942https://github.com/pydata/xarray/blob/ed1b865688b2437a434dbf5bd5e602ad714453db/xarray/core/dataarray.py#L942
#4266https://github.com/python/mypy/issues/4266
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699748004
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699762017
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699786020
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699788746
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699790393
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699795518
mypy/mypy/subtypes.pyhttps://github.com/python/mypy/blob/4fb5a21b443c1fe593d0e2d1cf063811efea4902/mypy/subtypes.py#L555
4fb5a21https://github.com/python/mypy/commit/4fb5a21b443c1fe593d0e2d1cf063811efea4902
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-699807532
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Sep 28, 2020https://github.com/python/mypy/issues/9437#issuecomment-700064698
hauntsaninjahttps://github.com/hauntsaninja
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
9ab622chttps://github.com/python/mypy/commit/9ab622cf557f1184dd040ff4b282c7a13ea3d976
on Sep 29, 2020https://github.com/python/mypy/issues/9437#event-3817414446
JukkaLhttps://github.com/JukkaL
on Oct 1, 2020https://github.com/python/mypy/issues/9437#event-3830421604
Fix partial type crash during protocol checking (#9495)https://github.com/python/mypy/commit/1bed354d5d4f08aa59a199db1a62e5b049f24756
#9495https://github.com/python/mypy/pull/9495
https://docs.github.com/articles/closing-issues-via-commit-messages
1bed354https://github.com/python/mypy/commit/1bed354d5d4f08aa59a199db1a62e5b049f24756
scivisionhttps://github.com/scivision
on Feb 7, 2021https://github.com/python/mypy/issues/9437#event-4299928892
mypy: strict_optional=False causes mypy to crashhttps://github.com/space-physics/msise00/commit/8b59a9383dd6fcc54b7dac74eb95a350308d7b62
8b59a93https://github.com/space-physics/msise00/commit/8b59a9383dd6fcc54b7dac74eb95a350308d7b62
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/9437
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/9437
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%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.