Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sobolevn opened this issue Mar 30, 2023 · 1 comment
Open

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

sobolevn opened this issue Mar 30, 2023 · 1 comment
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-argument-clinic type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Mar 30, 2023

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

@sobolevn sobolevn added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-argument-clinic labels Mar 30, 2023
@sobolevn sobolevn self-assigned this Mar 30, 2023
@sobolevn
Copy link
Member Author

sobolevn commented Mar 30, 2023

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.

sobolevn added a commit to sobolevn/cpython that referenced this issue Mar 30, 2023
@sobolevn sobolevn changed the title sys.getsizeof is not converted to AC sys.getsizeof and sys.set_asyncgen_hooks are not converted to AC Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-argument-clinic type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant