Title: bpo-46655: allow stringized TypeAlias with get_type_hints by GBeauregard · Pull Request #31156 · python/cpython · GitHub
Open Graph Title: bpo-46655: allow stringized TypeAlias with get_type_hints by GBeauregard · Pull Request #31156 · python/cpython
X Title: bpo-46655: allow stringized TypeAlias with get_type_hints by GBeauregard · Pull Request #31156 · python/cpython
Description: This is a bit weird; it isn't a type, after all. However, _type_check is called as part of stringized annotation resolution so all valid typeforms need a code path to get through it or we will cause errors for get_type_hints calls that may not even be intended to inspect the typeform of issue (e.g. called on a module or class). It also needs to be able to pass through _type_check if you want the typeform to be able to be contained in an Annotated (probably not a concern for TypeAlias). The most reasonable way I currently know to reach this is if you called get_type_hints on a module with a globally defined TypeAlias (that was stringized). See bpo for additional commentary. https://bugs.python.org/issue46655
Open Graph Description: This is a bit weird; it isn't a type, after all. However, _type_check is called as part of stringized annotation resolution so all valid typeforms need a code path to get through it or we will ...
X Description: This is a bit weird; it isn't a type, after all. However, _type_check is called as part of stringized annotation resolution so all valid typeforms need a code path to get through it or we w...
Opengraph URL: https://github.com/python/cpython/pull/31156
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:183856fe-3191-c6e9-6003-e9c89d86b202 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | C24E:9CC2A:214DBC7:2DF0B74:696AB9A0 |
| html-safe-nonce | c886c639cfccfdc85ee07f8f2f42d6df6c3db8905c16e62dba8f1cf1a43569cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjRFOjlDQzJBOjIxNERCQzc6MkRGMEI3NDo2OTZBQjlBMCIsInZpc2l0b3JfaWQiOiI0ODc4OTk1NTUwNTE5MzQzNTIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 8be128704149c46f2bdc4571525f7d5c72255d6fd68e71b66703d9e6000ea6e4 |
| hovercard-subject-tag | pull_request:841023090 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/python/cpython/pull/31156/checks |
| twitter:image | https://avatars.githubusercontent.com/u/1444900?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1444900?s=400&v=4 |
| og:image:alt | This is a bit weird; it isn't a type, after all. However, _type_check is called as part of stringized annotation resolution so all valid typeforms need a code path to get through it or we will ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 46ce962e0e18113ea447391b6ace8b02d4d2861e57b4fbab3658698f73d8855b |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 30300f30bb3949de255e84a146706a3bdb5c19c9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width