Title: bpo-29262: Add get_origin() and get_args() introspection helpers to typing by ilevkivskyi · Pull Request #13685 · python/cpython · GitHub
Open Graph Title: bpo-29262: Add get_origin() and get_args() introspection helpers to typing by ilevkivskyi · Pull Request #13685 · python/cpython
X Title: bpo-29262: Add get_origin() and get_args() introspection helpers to typing by ilevkivskyi · Pull Request #13685 · python/cpython
Description: This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in typing_inspect on PyPI, I propose to add these two most commonly used functions: get_origin() and get_args(). These are essentially thin public wrappers around private APIs: __origin__ and __args__. As discussed in the issue and on the typing tracker, exposing some public helpers instead of __origin__ and __args__ directly will give us more flexibility if we will decide to update the internal representation, while still maintaining backwards compatibility. The implementation is very simple an is essentially a copy from typing_inspect with one exception: ClassVar was special-cased in typing_inspect, but I think this special-casing doesn't really help and only makes things more complicated. https://bugs.python.org/issue29262
Open Graph Description: This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in typing_inspect on PyPI, I propose to add these two most commo...
X Description: This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in typing_inspect on PyPI, I propose to add these two most commo...
Opengraph URL: https://github.com/python/cpython/pull/13685
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:ad322ae8-14d6-7fe5-194a-79b52fec4900 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | C5AA:2F0D9B:75A28F:A58E27:696A29A9 |
| html-safe-nonce | 90c828f09498724719f37d97bba56f34b258dd6cf20bc0134c05c0422c1cdc41 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUFBOjJGMEQ5Qjo3NUEyOEY6QTU4RTI3OjY5NkEyOUE5IiwidmlzaXRvcl9pZCI6IjgwMTM2NzIyMDAyMzQ3NDAxMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 88f87f8eda85a7baed1fe0c7af0c47116d1825dbe6951fb1817b6a10b60e8a98 |
| hovercard-subject-tag | pull_request:283818660 |
| 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/13685/checks |
| twitter:image | https://avatars.githubusercontent.com/u/12005495?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12005495?s=400&v=4 |
| og:image:alt | This is an old feature request that appears from time to time. After a year of experimenting with various introspection capabilities in typing_inspect on PyPI, I propose to add these two most commo... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | a1022f03e4f0d91ea173e4e5dac892c982e0588c62f1ce56121d755a320a3569 |
| 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 | f472b8e6c7b3fdd5d0354972a3f4c516289bf0be |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width