Title: Conditional import of izip is problematic · Issue #1026 · python/mypy · GitHub
Open Graph Title: Conditional import of izip is problematic · Issue #1026 · python/mypy
X Title: Conditional import of izip is problematic · Issue #1026 · python/mypy
Description: Test code: try: from itertools import izip except ImportError: izip = zip In Python 3 mode, this complains that itertools doesn't define izip. This is correct but maybe inside try/except ImportError this should not be an error. In Python...
Open Graph Description: Test code: try: from itertools import izip except ImportError: izip = zip In Python 3 mode, this complains that itertools doesn't define izip. This is correct but maybe inside try/except ImportErro...
X Description: Test code: try: from itertools import izip except ImportError: izip = zip In Python 3 mode, this complains that itertools doesn't define izip. This is correct but maybe inside try/except Import...
Opengraph URL: https://github.com/python/mypy/issues/1026
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Conditional import of izip is problematic","articleBody":"Test code:\n\n```\ntry:\n from itertools import izip\nexcept ImportError:\n izip = zip\n```\n\nIn Python 3 mode, this complains that itertools doesn't define izip. This is correct but maybe inside `try/except ImportError` this should not be an error.\n\nIn Python 2 mode, this gives the dreaded \"Incompatible types\" errror:\n\n```\n/Users/guido/mypy_tests/mypy_izip.py:4: error: Incompatible types in assignment (expression has type overloaded function, variable has type overloaded function)\n```\n\nI guess this is another case of #649 that isn't handled yet.\n","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2015-11-30T23:18:29Z","url":"https://github.com/python/mypy/issues/1026"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:10551a05-a26d-6780-292c-8cece2d9fa63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9016:15D703:11CE6DB:175213E:6B000CE7 |
| html-safe-nonce | 8ffd88dc26a8b4b775619cfeb79e582ef90aa6c1c955c3e0a4763e7acce2326f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDE2OjE1RDcwMzoxMUNFNkRCOjE3NTIxM0U6NkIwMDBDRTciLCJ2aXNpdG9yX2lkIjoiNTExODkxODE1MzE4NjgzOTc4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2f80b137aee853a7038297ceee9bbcc5b65f5cd528e77b6fc4fb846122c686fa |
| hovercard-subject-tag | issue:119603850 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/1026/issue_layout |
| twitter:image | https://opengraph.githubassets.com/10e34b12ead62e48de8de0188bec8fdd31c7e8b28a6f183ce9a1689ea7d48d49/python/mypy/issues/1026 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/10e34b12ead62e48de8de0188bec8fdd31c7e8b28a6f183ce9a1689ea7d48d49/python/mypy/issues/1026 |
| og:image:alt | Test code: try: from itertools import izip except ImportError: izip = zip In Python 3 mode, this complains that itertools doesn't define izip. This is correct but maybe inside try/except ImportErro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| hostname | github.com |
| expected-hostname | github.com |
| None | cf7ee0062053ad9eb05b6e5de57bd96c2055708bcbada4144946b5ec129cf1d7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9cab7de176a56362d2aabcbb4d1e07e846eba8a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width