-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-37032: Add CodeType.replace() method #13542
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
Conversation
The docstring shows default values whereas... there are no default values. I'm not sure how to fix the Argument Clinic part. @serhiy-storchaka: any idea?
|
I don't know if is possible to eliminate the defaults but if you want all to display
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I left a comment on a possible way to have al defaults to None
I expect that "code.replace(co_argcount=None)" raises a TypeError, since None is an invalid value. Moreover, Py_ssize_t requires to manually downcast to int... I prefer to keep "=-1" for int parameters and "=None" for other types. I will go with the current implementation ;-) |
Currently it is not possible. |
@pierreglaser @ogrisel You may like this change. |
Is there a place where this can be documented? I had to find this PR to see how to use this function |
CodeType is only documented at: The replace() method can be documented there. |
I'm a little slow on the draw here, but I wrote up a PR to document this: #17776 |
https://bugs.python.org/issue37032