Title: (🐞) New union syntax inconsistent with old union syntax, now it contains `Any` · Issue #12224 · python/mypy · GitHub
Open Graph Title: (🐞) New union syntax inconsistent with old union syntax, now it contains `Any` · Issue #12224 · python/mypy
X Title: (🐞) New union syntax inconsistent with old union syntax, now it contains `Any` · Issue #12224 · python/mypy
Description: from typing import Union class A: def __init__(self, a): ... Test1 = str | A # error Test2 = Union[str, A] main.py:5: error: Expression type contains "Any" (has type "Type[A]") But no error on the last line https://mypy-play.net/?mypy=la...
Open Graph Description: from typing import Union class A: def __init__(self, a): ... Test1 = str | A # error Test2 = Union[str, A] main.py:5: error: Expression type contains "Any" (has type "Type[A]") But no error on the ...
X Description: from typing import Union class A: def __init__(self, a): ... Test1 = str | A # error Test2 = Union[str, A] main.py:5: error: Expression type contains "Any" (has type "Type[A]") ...
Opengraph URL: https://github.com/python/mypy/issues/12224
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"(🐞) New union syntax inconsistent with old union syntax, now it contains `Any`","articleBody":"```py\r\nfrom typing import Union\r\nclass A:\r\n def __init__(self, a): ...\r\n \r\nTest1 = str | A # error\r\nTest2 = Union[str, A]\r\n```\r\n`main.py:5: error: Expression type contains \"Any\" (has type \"Type[A]\")`\r\nBut no error on the last line\r\n\r\nhttps://mypy-play.net/?mypy=latest&python=3.10&flags=disallow-any-expr&gist=dd6dcaf336fb58d4afc3310200259630","author":{"url":"https://github.com/KotlinIsland","@type":"Person","name":"KotlinIsland"},"datePublished":"2022-02-21T03:31:41Z","url":"https://github.com/python/mypy/issues/12224"}
| 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:29254955-8f1c-9d14-25d2-9e4c8190bf1b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B926:3401DB:294961:3A4BA8:6B006A6A |
| html-safe-nonce | f1f8d9bcc11b09a178308cd2bc53ffe1e3b0a1a7e844bec8a1fd5e94a9d45fa7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTI2OjM0MDFEQjoyOTQ5NjE6M0E0QkE4OjZCMDA2QTZBIiwidmlzaXRvcl9pZCI6Ijg5MzU5MTc0MTk0OTEyNTY5MzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | fa9946ba50bf817a32e2de02bbb7258801ff0e47d771293581900af34ccd3e5e |
| hovercard-subject-tag | issue:1145278133 |
| 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/12224/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5974ebe77ba6b155b4664e7a11f68bb4a64f158c778ae5268be1ce2091f97b96/python/mypy/issues/12224 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5974ebe77ba6b155b4664e7a11f68bb4a64f158c778ae5268be1ce2091f97b96/python/mypy/issues/12224 |
| og:image:alt | from typing import Union class A: def __init__(self, a): ... Test1 = str | A # error Test2 = Union[str, A] main.py:5: error: Expression type contains "Any" (has type "Type[A]") But no error on the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | KotlinIsland |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6527e91c60c0b29d16606ff32ac5df8ecdc37a2a62205ea057a14d7762c870fa |
| 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 | 46f1cd2ae3cd8ae1a81019b5d619742e76f13bbd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width