Skip to content
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

Document the co_lines method on code objects #113682

Merged
merged 4 commits into from Jan 3, 2024

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jan 3, 2024

I noticed while preparing #112781 that this method wasn't documented properly, despite several deprecated things (that the method was meant to replace) being documented. So let's document it!

Most of the docs here are just copied from PEP-626: https://peps.python.org/pep-0626/#the-new-co-lines-method-of-code-objects


📚 Documentation preview 📚: https://cpython-previews--113682.org.readthedocs.build/

Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
AlexWaygood and others added 2 commits January 3, 2024 17:21
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@AlexWaygood
Copy link
Member Author

It looks like I maybe still haven't got the formatting quite right for the .. seealso:: box, but I'm not sure what I'm doing wrong.

This .. seealso:: box:

image

Other .. seealso:: box (has a nice line break in between the "See also" heading and the next line):

image

The other one is here:

.. seealso::
:pep:`562` - Module __getattr__ and __dir__
Describes the ``__getattr__`` and ``__dir__`` functions on modules.

@Eclips4
Copy link
Member

Eclips4 commented Jan 3, 2024

It's looks good for me:

image

@hugovk
Copy link
Member

hugovk commented Jan 3, 2024

Also good for me on mobile:

Details

Screenshot_20240103_211511_Chrome

@AlexWaygood
Copy link
Member Author

Weird, I'm still seeing it on Firefox (have tried clearing the cache, still seeing it), but not on Opera. Eh, not the biggest issue in the world anyway :)

@AlexWaygood AlexWaygood merged commit f1f8392 into python:main Jan 3, 2024
31 checks passed
@AlexWaygood AlexWaygood deleted the document-co-lines branch January 3, 2024 19:29
@miss-islington-app
Copy link

Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤄1�7

@miss-islington-app
Copy link

Sorry, @AlexWaygood, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f1f839243251fef7422c31d6a7c3c747e0b5e27c 3.12

@miss-islington-app
Copy link

Sorry, @AlexWaygood, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f1f839243251fef7422c31d6a7c3c747e0b5e27c 3.11

@bedevere-app
Copy link

bedevere-app bot commented Jan 3, 2024

GH-113686 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jan 3, 2024
@AlexWaygood AlexWaygood removed the needs backport to 3.11 bug and security fixes label Jan 3, 2024
AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Jan 3, 2024
(cherry-picked from commit f1f8392)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Jan 3, 2024

GH-113687 is a backport of this pull request to the 3.11 branch.

AlexWaygood added a commit to AlexWaygood/cpython that referenced this pull request Jan 3, 2024
(cherry-picked from commit f1f8392)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
AlexWaygood added a commit that referenced this pull request Jan 3, 2024
)

(cherry-picked from commit f1f8392)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
AlexWaygood added a commit that referenced this pull request Jan 3, 2024
)

(cherry-picked from commit f1f8392)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants