Title: GH-118761: Expose more core interpreter types in ``_types`` by AA-Turner · Pull Request #132103 · python/cpython · GitHub
Open Graph Title: GH-118761: Expose more core interpreter types in ``_types`` by AA-Turner · Pull Request #132103 · python/cpython
X Title: GH-118761: Expose more core interpreter types in ``_types`` by AA-Turner · Pull Request #132103 · python/cpython
Description: This was discussed in #131969 (cc @ZeroIntensity), but deferred to get the smaller change in. This PR adds all of the core interpreter types currently exposed in the types module to _typesmodule.c. We then change the definition of types.py to prefer these, but if the _types module is not available, to use the pure-Python fallbacks. Strictly, this isn't needed, as _types is a built-in module. I think it might be helpful to keep the pure Python definitions for other implementations (PyPy, etc), and perhaps as a quick reminder of what each type looks like. Open to thoughts on this, as it would clearly be simpler to replace everything with from _types import *. I've initially categorised this under #118761, as this does provide a ~15% speed-up for me (1627µs to 1403µs). A Issue: gh-118761
Open Graph Description: This was discussed in #131969 (cc @ZeroIntensity), but deferred to get the smaller change in. This PR adds all of the core interpreter types currently exposed in the types module to _typesmodule.c....
X Description: This was discussed in #131969 (cc @ZeroIntensity), but deferred to get the smaller change in. This PR adds all of the core interpreter types currently exposed in the types module to _typesmodule.c....
Opengraph URL: https://github.com/python/cpython/pull/132103
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:a3cec4cd-5865-851d-6d6d-503fb4250d24 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | EA94:70C3B:29F295:38D012:6969D231 |
| html-safe-nonce | 38683157eac35cd713ba8e2ffb4f991912c2d5c8993dc6398296b69a70691819 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTk0OjcwQzNCOjI5RjI5NTozOEQwMTI6Njk2OUQyMzEiLCJ2aXNpdG9yX2lkIjoiNzU0OTI1NzgwMzEzMDA2NTQ1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8c4de3706b378830dabbf58e8940294a380158b28a5961f21417f49d6daf186e |
| hovercard-subject-tag | pull_request:2440634497 |
| 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/132103/checks |
| twitter:image | https://avatars.githubusercontent.com/u/9087854?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9087854?s=400&v=4 |
| og:image:alt | This was discussed in #131969 (cc @ZeroIntensity), but deferred to get the smaller change in. This PR adds all of the core interpreter types currently exposed in the types module to _typesmodule.c.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| turbo-cache-control | no-cache |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width