bpo-37032: Add CodeType.replace() method#13542
bpo-37032: Add CodeType.replace() method#13542vstinner merged 5 commits intopython:masterfrom vstinner:code_replace
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 |
pablogsal
left a comment
There was a problem hiding this comment.
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