Title: gh-89653: PEP 670: Convert macros to functions by vstinner · Pull Request #99843 · python/cpython · GitHub
Open Graph Title: gh-89653: PEP 670: Convert macros to functions by vstinner · Pull Request #99843 · python/cpython
X Title: gh-89653: PEP 670: Convert macros to functions by vstinner · Pull Request #99843 · python/cpython
Description: Convert macros to static inline functions to avoid macro pitfalls, like duplication of side effects: DK_ENTRIES() DK_UNICODE_ENTRIES() PyCode_GetNumFree() PyFloat_AS_DOUBLE() PyInstanceMethod_GET_FUNCTION() PyMemoryView_GET_BASE() PyMemoryView_GET_BUFFER() PyMethod_GET_FUNCTION() PyMethod_GET_SELF() PySet_GET_SIZE() _PyHeapType_GET_MEMBERS() Changes: Add also assertions in some functions using "CAST" macro to check the type of the arguments when Python is built with assertions (debug build). Remove an outdated comment in unicodeobject.h. PyCode_GetNumFree() doesn't cast its argument: the replaced macro already required the exact type PyCodeObject*. PyCode_GetNumFree() casts PyCode_GetNumFree.co_nfreevars from int to Py_ssize_t to be future proof, and because Py_ssize_t is commonly used in the C API. Issue: gh-89653
Open Graph Description: Convert macros to static inline functions to avoid macro pitfalls, like duplication of side effects: DK_ENTRIES() DK_UNICODE_ENTRIES() PyCode_GetNumFree() PyFloat_AS_DOUBLE() PyInstanceMethod_GET_...
X Description: Convert macros to static inline functions to avoid macro pitfalls, like duplication of side effects: DK_ENTRIES() DK_UNICODE_ENTRIES() PyCode_GetNumFree() PyFloat_AS_DOUBLE() PyInstanceMethod_GET_...
Opengraph URL: https://github.com/python/cpython/pull/99843
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8c942a1a-07cf-4a97-8343-1cd567c02c9d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A2DA:21E6C4:D206C3:124FEAA:696A3942 |
| html-safe-nonce | 228e4dfce1e94434f1143a7cad53efa3626e72de7e1e7c0fb4320af79c1f9013 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkRBOjIxRTZDNDpEMjA2QzM6MTI0RkVBQTo2OTZBMzk0MiIsInZpc2l0b3JfaWQiOiI3MDI3NzIwMjcyMjY5MTYyODE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d3af90314a5f160b37a7911ac880df63e1f619b91d7ad6566820fa4b15632ae5 |
| hovercard-subject-tag | pull_request:1137653951 |
| 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/99843/files |
| twitter:image | https://avatars.githubusercontent.com/u/194129?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/194129?s=400&v=4 |
| og:image:alt | Convert macros to static inline functions to avoid macro pitfalls, like duplication of side effects: DK_ENTRIES() DK_UNICODE_ENTRIES() PyCode_GetNumFree() PyFloat_AS_DOUBLE() PyInstanceMethod_GET_... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 321736bfdb3f591415ae895a0459bec204b26a76caf47ba5c980634cfacc4538 |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7a9163cefd1ea4bd06f8eb7c082f43e4e53f626f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width