This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients larry, serhiy.storchaka, vstinner, yselivanov
Date 2020-11-08.10:38:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604831894.32.0.00722269509991.issue42291@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-11-08 10:38:14serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, larry, yselivanov
2020-11-08 10:38:14serhiy.storchakasetmessageid: <1604831894.32.0.00722269509991.issue42291@roundup.psfhosted.org>
2020-11-08 10:38:14serhiy.storchakalinkissue42291 messages
2020-11-08 10:38:14serhiy.storchakacreate