Repository navigation
Closed
Labels
3.10 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
| BPO | 42291 |
|---|---|
| Nosy | @vstinner, @larryhastings, @serhiy-storchaka, @1st1 |
| PRs |
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:
assignee = None
closed_at = None
created_at = <Date 2020-11-08.10:38:14.301>
labels = ['type-bug', '3.8', '3.9', '3.10', 'library', 'expert-argument-clinic']
title = 'Incorrect signature of CodeType.replace()'
updated_at = <Date 2020-11-09.14:46:09.424>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2020-11-09.14:46:09.424>
actor = 'vstinner'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)', 'Argument Clinic']
creation = <Date 2020-11-08.10:38:14.301>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 42291
keywords = ['patch']
message_count = 2.0
messages = ['380545', '380587']
nosy_count = 4.0
nosy_names = ['vstinner', 'larry', 'serhiy.storchaka', 'yselivanov']
pr_nums = ['23199']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue42291'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']Linked PRs
- [3.12] gh-86457: Fix signature for code.replace() (GH-23199) #107744
- [3.11] gh-86457: Fix signature for code.replace() (GH-23199) #107746
- gh-86457: Add docs for Argument Clinic @text_signature directive #107747
- [3.11] gh-86457: Add docs for Argument Clinic @text_signature directive (#107747) #107799
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-argument-clinictype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
serhiy-storchaka commentedon Nov 8, 2020
Currently the signature of types.CodeType.replace() is
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.
vstinner commentedon Nov 9, 2020
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).
pythongh-86457: Fix signature for code.replace().
gh-86457: Fix signature for code.replace() (GH-23199)
[3.12] pythongh-86457: Fix signature for code.replace() (pythonGH-23199)
[3.11] pythongh-86457: Fix signature for code.replace() (pythonGH-23199)
pythongh-86457: Add docs for Argument Clinic @text_signature directive
gh-86457: Add docs for Argument Clinic @text_signature directive (#10…
[3.11] gh-86457: Fix signature for code.replace() (GH-23199) (GH-107746)
[3.11] pythongh-86457: Add docs for Argument Clinic @text_signature d…
[3.11] gh-86457: Add docs for Argument Clinic @text_signature directi…
[3.12] gh-86457: Fix signature for code.replace() (GH-23199) (#107744)
python/cpython#86457: Add docs for Argument Clinic @text_signature di…
python/cpython#86457: Add docs for Argument Clinic @text_signature di…