-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Incorrect signature of CodeType.replace() #86457
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
Comments
Currently the signature of types.CodeType.replace() is replace(self, /, *, co_argcount=-1, co_posonlyargcount=-1, co_kwonlyargcount=-1, co_nlocals=-1, co_stacksize=-1, co_flags=-1, co_firstlineno=-1, co_code=None, co_consts=None, co_names=None, co_varnames=None, co_freevars=None, co_cellvars=None, co_filename=None, co_name=None, co_lnotab=None) But -1 and None are incorrect values for many parameters, and even if they would be correct, they are not default values. By default, if you do not specify some argument, the value of the corresponding attribute would not be changed. Argument Clinic and the inspect module do not support this case. |
That's why I used -1 and None.
If you consider that this issue matters, you may hack the code to accept None as if no parameter was passed (pass NULL). |
Also add support of @text_signature in Argument Clinic.
Also add support of @text_signature in Argument Clinic.. (cherry picked from commit 0e6e32f) Co-authored-by: Serhiy Storchaka <[email protected]>
Also add support of @text_signature in Argument Clinic.. (cherry picked from commit 0e6e32f) Co-authored-by: Serhiy Storchaka <[email protected]>
…7747) Co-authored-by: Alex Waygood <[email protected]>
…irective (python#107747) (cherry picked from commit a9aeb99) Co-authored-by: Alex Waygood <[email protected]>
…ve (#107747) (#107799) (cherry picked from commit a9aeb99) Co-authored-by: Alex Waygood <[email protected]>
* [3.12] gh-86457: Fix signature for code.replace() (GH-23199) Also add support of @text_signature in Argument Clinic.. (cherry picked from commit 0e6e32f) Co-authored-by: Serhiy Storchaka <[email protected]> * Update 2023-08-07-16-30-48.gh-issue-95065.-im4R5.rst
…rective (python/cpython#107747) Co-authored-by: Alex Waygood <[email protected]>
…rective (python/cpython#107747) Co-authored-by: Alex Waygood <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: