Skip to content

sys.getsizeof and sys.set_asyncgen_hooks are not converted to AC #103131

Description

@sobolevn

I found this while working on python/typeshed#9987 I've noticed that most of the functions inside sys do have __text_signature__. While sys.getsizeof doesn't.

>>> import sys
>>> sys.addaudithook.__text_signature__
'($module, /, hook)'
>>> sys.getsizeof.__text_signature__

I think this is not a planned feature. This is the artifact of times when NULL was not supported as a default value by AC. See original review comment #11328 (comment)

I think that this should be fixed. I will send a PR with this function converted, it take a very minimal diff to do that.

Linked PRs

Activity

  1. self-assigned this
    on Mar 30, 2023
  2. sobolevn commented on Mar 30, 2023

    @sobolevn
    MemberAuthor

    Hm, there's also set_asyncgen_hooks that can be easily converted, so we can consider sys complete. It was not included originally due to the same NULL problem: #11328 (comment)

    Other functions are either not worth touching: like METH_O or too complex, like sys_breakpointhook.

  3. added a commit that references this issue on Mar 30, 2023
  4. changed the title [-]`sys.getsizeof` is not converted to AC[/-] [+]`sys.getsizeof` and `sys.set_asyncgen_hooks` are not converted to AC[/+] on Mar 30, 2023
  5. added
    type-refactorCode refactoring (with no changes in behavior)
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions