New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:
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. ---------- components: Argument Clinic, Library (Lib) messages: 380545 nosy: larry, serhiy.storchaka, vstinner, yselivanov priority: normal severity: normal status: open title: Incorrect signature of CodeType.replace() type: behavior versions: Python 3.10, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42291> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com