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 traceback.print_list #127347

Closed
tomasr8 opened this issue Nov 27, 2024 · 8 comments
Closed

Document traceback.print_list #127347

tomasr8 opened this issue Nov 27, 2024 · 8 comments
Labels
docs Documentation in the Doc dir stdlib Python modules in the Lib dir

Comments

@tomasr8
Copy link
Member

tomasr8 commented Nov 27, 2024

traceback.print_list is currently undocumented, let's fix that! I'll send a PR shortly :)

Linked PRs

@serhiy-storchaka
Copy link
Member

Why is it undocumented? Why it has not been added in __all__? What is the difference with format_list()? I have no currently access to my computer, but please research the history of these functions. If it is an oversign, we may need a versionadded directive and maybe even a What's New entry. This may be not a pure documentation issue.

@tomasr8
Copy link
Member Author

tomasr8 commented Nov 29, 2024

You're right, I should've done some research to understand why it's undocumented. I'll check tomorrow :)

@picnixz picnixz added the stdlib Python modules in the Lib dir label Nov 30, 2024
@tomasr8
Copy link
Member Author

tomasr8 commented Nov 30, 2024

So I did some code archaeology and the function was added in dcc057a together with format_list. Neither were documented in this commit. format_list and a bunch of other functions (except for print_list) were documented (in Doc/lib/libtraceback.tex) two years later in bca1207. The docs were then migrated from tex to rst in 116aa62. To me this just seems like an unintentional omission so I think it makes sense to document it. Not sure if we should add versionadded (can we for such an old function?) or a What's New entry.

What is the difference with format_list()?

print_list is a wrapper on top of format_list which directly prints the stack trace.

@serhiy-storchaka
Copy link
Member

What about __all__. format_list was not initially in __all__.

@Eclips4
Copy link
Member

Eclips4 commented Nov 30, 2024

What about __all__. format_list was not initially in __all__.

A bunch of __all__ were added in 40fc160, and it seems like an unintentional omission to me. (print_last and print_list sound pretty similar, so it's easy to accidentally skip one of them, I guess.)

@serhiy-storchaka
Copy link
Member

Thank you for your investigation. Let document that function, but only add it to __all__ in main (because it may be a breaking change). No versionadded is needed if it was here before 3.0.

Eclips4 pushed a commit that referenced this issue Dec 3, 2024
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 3, 2024
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
(cherry picked from commit 8ba9f5b)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 3, 2024
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
(cherry picked from commit 8ba9f5b)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@StanFromIreland
Copy link
Contributor

This issue can be closed. A PR has been merged and just backports are left.

@tomasr8
Copy link
Member Author

tomasr8 commented Dec 3, 2024

This issue can be closed. A PR has been merged and just backports are left.

The backports still require some manual work, I'd prefer to keep this open until they are merged as well :)

Eclips4 pushed a commit that referenced this issue Dec 4, 2024
Add an documentation entry about `traceback.print_list`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Eclips4 pushed a commit that referenced this issue Dec 4, 2024
Add an documentation entry about `traceback.print_list`

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
@Eclips4 Eclips4 closed this as completed Dec 4, 2024
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
ebonnal pushed a commit to ebonnal/cpython that referenced this issue Jan 12, 2025
Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir stdlib Python modules in the Lib dir
Projects
Status: Todo
Development

No branches or pull requests

5 participants