Title: Union type aliases valid as expressions · Issue #329 · python/mypy · GitHub
Open Graph Title: Union type aliases valid as expressions · Issue #329 · python/mypy
X Title: Union type aliases valid as expressions · Issue #329 · python/mypy
Description: Type aliases can be used in expressions without issues: from typing import Union x = Union[int, str] x.foo # No error x = [1] # No error I think using a Union type alias in an expression should probably be disallowed, or it should have a...
Open Graph Description: Type aliases can be used in expressions without issues: from typing import Union x = Union[int, str] x.foo # No error x = [1] # No error I think using a Union type alias in an expression should pro...
X Description: Type aliases can be used in expressions without issues: from typing import Union x = Union[int, str] x.foo # No error x = [1] # No error I think using a Union type alias in an expression should pro...
Opengraph URL: https://github.com/python/mypy/issues/329
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Union type aliases valid as expressions","articleBody":"Type aliases can be used in expressions without issues:\n\n```\nfrom typing import Union\nx = Union[int, str]\nx.foo # No error\nx = [1] # No error\n```\n\nI think using a Union type alias in an expression should probably be disallowed, or it should have a narrow type. Aliases to simple types such as \"x = int\" should be equivalent to the alias target.\n","author":{"url":"https://github.com/JukkaL","@type":"Person","name":"JukkaL"},"datePublished":"2014-07-25T19:20:08Z","url":"https://github.com/python/mypy/issues/329"}
| 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:c0def31c-3631-9a2c-eef4-3df93d273bf2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83D8:132D8D:332F4A:45C5CB:6B006B57 |
| html-safe-nonce | 76e0a65da861cee25bc48e890d5366b7fa0454b6ee2ca30be1048216be533ed9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0Q4OjEzMkQ4RDozMzJGNEE6NDVDNUNCOjZCMDA2QjU3IiwidmlzaXRvcl9pZCI6IjExMDgyNTIwNzY5OTcxMTA2MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 38898a34ef14bfdf4964475046657bb2f96ebd62d284284504ee1b5b10eabc6b |
| hovercard-subject-tag | issue:38761834 |
| 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/329/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bf869d42951de5d62fa97c5d012260342f1ab21464de812dbeb2d3d4ae49c667/python/mypy/issues/329 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bf869d42951de5d62fa97c5d012260342f1ab21464de812dbeb2d3d4ae49c667/python/mypy/issues/329 |
| og:image:alt | Type aliases can be used in expressions without issues: from typing import Union x = Union[int, str] x.foo # No error x = [1] # No error I think using a Union type alias in an expression should pro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JukkaL |
| 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