Skip to content

codeobject.replace function is undocumented #115572

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

Closed
Eclips4 opened this issue Feb 16, 2024 · 3 comments
Closed

codeobject.replace function is undocumented #115572

Eclips4 opened this issue Feb 16, 2024 · 3 comments
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes docs Documentation in the Doc dir

Comments

@Eclips4
Copy link
Member

Eclips4 commented Feb 16, 2024

Bug description:

codeobject.replace function was introduced in a9f05d6, but there's only a note in Doc/whatsnew.
My folk @daler-sz would like to work on a fix :)

CPython versions tested on:

3.11, 3.12, 3.13

Operating systems tested on:

No response

Linked PRs

@Eclips4 Eclips4 added the docs Documentation in the Doc dir label Feb 16, 2024
@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 16, 2024

It looks like there are some very short docs on the method here: https://docs.python.org/3/library/types.html#types.CodeType.replace

But it's in the wrong place; all other code object attributes and methods are documented here: https://docs.python.org/3/reference/datamodel.html#code-objects.

Also, the docs for types.CodeType should link to the "proper" docs on code objects in the data model; they currently don't

@Eclips4
Copy link
Member Author

Eclips4 commented Feb 16, 2024

Oh, there already an entry in https://docs.python.org/3.12/library/types.html#types.CodeType, but there's nothing about co_positions, co_lines and others.

Another doc about code objects: https://docs.python.org/3.12/reference/datamodel.html#methods-on-code-objects
I think they are both should be updated

@Eclips4 Eclips4 added 3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes labels Feb 18, 2024
Eclips4 pushed a commit to Eclips4/cpython that referenced this issue Feb 18, 2024
AlexWaygood pushed a commit that referenced this issue Feb 18, 2024
#115632)

* [3.11] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4)

Co-authored-by: Daler <[email protected]>

* Remove note about copy.replace

---------

Co-authored-by: Daler <[email protected]>
AlexWaygood pushed a commit that referenced this issue Feb 18, 2024
#115633)

* [3.12] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4)

Co-authored-by: Daler <[email protected]>

* Remove note about copy.replace

---------

Co-authored-by: Daler <[email protected]>
@Eclips4
Copy link
Member Author

Eclips4 commented Feb 18, 2024

Thanks @daler-sz for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 only security fixes 3.13 bugs and security fixes docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants