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/commits/:range(.:format) |
| route-controller | pull_requests |
| route-action | commits |
| fetch-nonce | v2:e9630e31-4ff0-8d6a-7b0f-cab56fec165b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8246:239779:781CB04:A2FB69A:69960B38 |
| html-safe-nonce | 27edb393d1d99eaaec108e63faa4ad2f46fcee46ec597ae02b6191956f503e4a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjQ2OjIzOTc3OTo3ODFDQjA0OkEyRkI2OUE6Njk5NjBCMzgiLCJ2aXNpdG9yX2lkIjoiMzU3ODEyMTA1OTc0NzM2NzczNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 43a2115ed028d0a5d5481cf23aebab70dc715a51e6b2cf8e0f9fa8c2bb264b5b |
| hovercard-subject-tag | pull_request:841023090 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/commits/7b425d9bced0b51f8c35138346ec9dffec6b561f |
| 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 | 7490a2fd98baca866acf503b81aa249491b42e5b4bab7f7a2801be81175c8845 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7df053103622790f523ce252eca7a6472dc73d27 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width