Title: PEP 670: Convert static inline functions to functions · Issue #97016 · python/cpython · GitHub
Open Graph Title: PEP 670: Convert static inline functions to functions · Issue #97016 · python/cpython
X Title: PEP 670: Convert static inline functions to functions · Issue #97016 · python/cpython
Description: PEP 670 converted macros to static inline functions in Python 3.11. I propose to implement the second phase of PEP 670: convert static inline functions to regular functions in Python 3.12. Static inline functions are causing C++ warnings...
Open Graph Description: PEP 670 converted macros to static inline functions in Python 3.11. I propose to implement the second phase of PEP 670: convert static inline functions to regular functions in Python 3.12. Static i...
X Description: PEP 670 converted macros to static inline functions in Python 3.11. I propose to implement the second phase of PEP 670: convert static inline functions to regular functions in Python 3.12. Static i...
Opengraph URL: https://github.com/python/cpython/issues/97016
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PEP 670: Convert static inline functions to functions","articleBody":"[PEP 670](https://peps.python.org/pep-0670/) converted macros to static inline functions in Python 3.11. I propose to implement the second phase of PEP 670: convert static inline functions to regular functions in Python 3.12.\r\n\r\nStatic inline functions are causing C++ warnings. I had to add _Py_CAST() and _Py_NULL macros to Python 3.11 to limit the number of C++ warnings. The _Py_CAST() macro has a complicated history. @serge-sans-paille helped me to write a correct C++ implementation of _Py_CAST(), but it had to be reverted to fix the issue #94731. See:\r\n\r\n* https://github.com/python/cpython/pull/94782\r\n* https://github.com/python/cpython/pull/32175#issuecomment-1181938543\r\n* https://github.com/python/cpython/pull/94782\r\n\r\n[As explained in PEP 670](https://peps.python.org/pep-0670/#convert-static-inline-functions-to-regular-functions), static inline functions cannot be used in programming languages other than C, and these functions cannot be loaded by loading the symbol from the Python library (libpython). For example, the vim text editor loads uses the Python C API by loading symbols.\r\n\r\nConverting static inline functions also hides implementation details. When using regular function calls, at the ABI level, it's just a regular function call, the machine code doesn't access directly structure members. So we have more freedom to changes Python internals (like the structure).\r\n\r\nThis issue is not about changing Python internals. It's just about convert static inline functions to regular functions.","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2022-09-22T15:41:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/97016/cpython/issues/97016"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e5a87b78-2d12-8be3-108d-ea0049a8d9c1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1DC:22BD75:A43C50:E68614:696A5F2F |
| html-safe-nonce | 2b8f3b034dcf54ba25fd54fea2fa0e5608b7e722007500e5aa13dd113e38bfc7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMURDOjIyQkQ3NTpBNDNDNTA6RTY4NjE0OjY5NkE1RjJGIiwidmlzaXRvcl9pZCI6IjEzODE4MzU4NzE2MTM1MDk0MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 22e6549b42414dbea1bb3a101316b5315d971daa787081321aaf6b008cca1ff4 |
| hovercard-subject-tag | issue:1382657845 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/97016/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9782f775a3787c5551c648485aa86981eaaeb86d8e59303955f7d7329b5ec8ba/python/cpython/issues/97016 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9782f775a3787c5551c648485aa86981eaaeb86d8e59303955f7d7329b5ec8ba/python/cpython/issues/97016 |
| og:image:alt | PEP 670 converted macros to static inline functions in Python 3.11. I propose to implement the second phase of PEP 670: convert static inline functions to regular functions in Python 3.12. Static i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9b7735a184970dd9333b2cbe036c8f3c0a9108c64aaa93827c5a64fc70993392 |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 87cbd411c2982752221b5751d583a515b23bf5fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width