Title: PyFunction_GetAnnotations is probably causing ref leaks · Issue #97943 · python/cpython · GitHub
Open Graph Title: PyFunction_GetAnnotations is probably causing ref leaks · Issue #97943 · python/cpython
X Title: PyFunction_GetAnnotations is probably causing ref leaks · Issue #97943 · python/cpython
Description: In issue #30409 PyFunction_GetAnnotations was fixed so it wouldn't return a tuple. That's good. But this change changed the return value. PyFunction_GetAnnotations now returns a new reference to the annotations dict. But according to the...
Open Graph Description: In issue #30409 PyFunction_GetAnnotations was fixed so it wouldn't return a tuple. That's good. But this change changed the return value. PyFunction_GetAnnotations now returns a new reference to th...
X Description: In issue #30409 PyFunction_GetAnnotations was fixed so it wouldn't return a tuple. That's good. But this change changed the return value. PyFunction_GetAnnotations now returns a new referen...
Opengraph URL: https://github.com/python/cpython/issues/97943
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PyFunction_GetAnnotations is probably causing ref leaks","articleBody":"In issue #30409 `PyFunction_GetAnnotations` was fixed so it wouldn't return a tuple. That's good.\r\n\r\nBut this change changed the return value. `PyFunction_GetAnnotations` now returns a *new* reference to the annotations dict. But according to the documentation, it should return a *borrowed* reference.\r\n\r\n https://docs.python.org/3/c-api/function.html#c.PyFunction_GetAnnotations\r\n\r\nIf users only read the documentation, and assume that it's correct, they'll leak a reference to the annotation dict.\r\n\r\nWe could fix this by changing the documentation. However, all the other `PyFunction_Get*` functions *also* return borrowed references. So I think the correct fix is to remove the incref.","author":{"url":"https://github.com/larryhastings","@type":"Person","name":"larryhastings"},"datePublished":"2022-10-05T23:12:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/97943/cpython/issues/97943"}
| 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:8c0df8b1-31b2-6bc9-fb23-a406810ec3a1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC40:2D2FEF:8333BD:B0ECEE:6969790C |
| html-safe-nonce | 6005d9a33495c4bbb707d420507500cc7d30d3deac65a68fa288fbe84d804a16 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzQwOjJEMkZFRjo4MzMzQkQ6QjBFQ0VFOjY5Njk3OTBDIiwidmlzaXRvcl9pZCI6IjE2OTMzNzE1MTc3MDIzMzg4MjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8d430ae02d65b6787d73efe2b53bdb8e3c75077f03bceb1ad55bc5900248d794 |
| hovercard-subject-tag | issue:1398491239 |
| 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/97943/issue_layout |
| twitter:image | https://opengraph.githubassets.com/deceafff0c9afd3fd73e4d43b778e22fbf2787abe3a9b4e27139952963c88295/python/cpython/issues/97943 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/deceafff0c9afd3fd73e4d43b778e22fbf2787abe3a9b4e27139952963c88295/python/cpython/issues/97943 |
| og:image:alt | In issue #30409 PyFunction_GetAnnotations was fixed so it wouldn't return a tuple. That's good. But this change changed the return value. PyFunction_GetAnnotations now returns a new reference to th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | larryhastings |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| 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 | 212e3e3d3298bf5b313830edfd2399e869f7ea76 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width