Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PyFunction_GetAnnotations is probably causing ref leaks #97943

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@larryhastings

Description

@larryhastings

In issue#30409PyFunction_GetAnnotations was fixed so it wouldn't return a tuple. That's good.

But this change changed the return value.PyFunction_GetAnnotations now returns anew reference to the annotations dict. But according to the documentation, it should return aborrowed reference.

https://docs.python.org/3/c-api/function.html#c.PyFunction_GetAnnotations

If users only read the documentation, and assume that it's correct, they'll leak a reference to the annotation dict.

We could fix this by changing the documentation. However, all the otherPyFunction_Get* functionsalso return borrowed references. So I think the correct fix is to remove the incref.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp