Title: Inconsistency in whether function setters call `_PyFunction_SetVersion` · Issue #109998 · python/cpython · GitHub
Open Graph Title: Inconsistency in whether function setters call `_PyFunction_SetVersion` · Issue #109998 · python/cpython
X Title: Inconsistency in whether function setters call `_PyFunction_SetVersion` · Issue #109998 · python/cpython
Description: Bug report The function object has a number of settable attributes. For the following, setting the value calls _PyFunction_SetVersion(op, 0): __defaults__ __kwdefaults__ __code__ __annotations__ But for the following, there is no such ca...
Open Graph Description: Bug report The function object has a number of settable attributes. For the following, setting the value calls _PyFunction_SetVersion(op, 0): __defaults__ __kwdefaults__ __code__ __annotations__ Bu...
X Description: Bug report The function object has a number of settable attributes. For the following, setting the value calls _PyFunction_SetVersion(op, 0): __defaults__ __kwdefaults__ __code__ __annotations__ Bu...
Opengraph URL: https://github.com/python/cpython/issues/109998
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistency in whether function setters call `_PyFunction_SetVersion`","articleBody":"# Bug report\n\nThe function object has a number of settable attributes. For the following, setting the value calls `_PyFunction_SetVersion(op, 0)`:\n\n- `__defaults__`\n- `__kwdefaults__`\n- `__code__`\n- `__annotations__`\n\nBut for the following, there is no such call:\n\n- `__dict__`\n- `__name__`\n- `__qualname__`\n- `__type_params__`\n\nI don't think any of these four should affect the interpreter loop, but neither should `__annotations__`. Should these setters also set the version for consistency, or should `__annotations__` not set it as changing the annotations shouldn't affect the runtime?\n\ncc @markshannon who added this in #27078.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2023-09-28T02:24:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/109998/cpython/issues/109998"}
| 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:f483a984-9d7e-463f-727f-9ee43f1a58cf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 993E:3F5325:3605095:4D63822:6A569262 |
| html-safe-nonce | e57d71974337612558a54997fc8f3481f2c692f4748daf29e476e03b956114a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTNFOjNGNTMyNTozNjA1MDk1OjRENjM4MjI6NkE1NjkyNjIiLCJ2aXNpdG9yX2lkIjoiMzM1MjQ2NTQ2MjMwMzAzNjAwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 910e5f0be8f30bb1b2f371d0b61013e4e3fd7e282234fdc2b97fe160e27ace90 |
| hovercard-subject-tag | issue:1916600172 |
| 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/109998/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bbbc009812ccce0669acfa1e3b33351047edd40ff22cff0d763a06e7ff92772b/python/cpython/issues/109998 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bbbc009812ccce0669acfa1e3b33351047edd40ff22cff0d763a06e7ff92772b/python/cpython/issues/109998 |
| og:image:alt | Bug report The function object has a number of settable attributes. For the following, setting the value calls _PyFunction_SetVersion(op, 0): __defaults__ __kwdefaults__ __code__ __annotations__ Bu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38 |
| 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 | 78af172a48a2056810bb627ffa684003e4f9a5ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width