Skip to content

gh-118359: Add notes for Bdb.user_call #118368

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

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

gaogaotiantian
Copy link
Member

@gaogaotiantian gaogaotiantian commented Apr 28, 2024

argument_list of bdb.Bdb.user_call will always be None now.


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

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Apr 28, 2024
@gaogaotiantian
Copy link
Member Author

This is a rather simple one, @AlexWaygood could you maybe take a look at this? Thanks!

@@ -240,6 +240,11 @@ The :mod:`bdb` module also defines two classes:
Called from :meth:`dispatch_call` if a break might stop inside the
called function.

.. note::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note directive is too loud. If we don't want to attract special attention to an important note, we usually write a note as a plain text.

Should not there be a versionchanged directive for this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we want to just add this as a normal text to the method. The versionchanged would probably be 2.x or 1.x, do we really want to search for the exact version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with just adding as normal text, without the .. note:: directive. I think if the parameter really has been unused for 25 years, it's okay to not have a .. versionchanged directive.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only add versionadded directives for 3.x changes. If it has been always unused in Python 3, no versionadded directive is needed. But mention this in the commit message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message into main is generated when the PR is squash merged so I don't think I can do that now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either I or Serhiy (whoever merges this) will have the ability to edit the commit message when squash-merging the PR

@@ -240,6 +240,11 @@ The :mod:`bdb` module also defines two classes:
Called from :meth:`dispatch_call` if a break might stop inside the
called function.

.. note::

*argument_list* is not used anymore and will always be :data:`None`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, Note is usually formatted as ``Note``.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You meant None?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, None.

@AlexWaygood
Copy link
Member

The "# XXX 'arg' is no longer used" comment referred to in #118359 (comment) appears to be this one:

# XXX 'arg' is no longer used

The comment appears to have been there for 25 years. Just to make sure I understand correctly: does that mean that this parameter has been unused for 25 years?

@gaogaotiantian
Copy link
Member Author

The comment appears to have been there for 25 years. Just to make sure I understand correctly: does that mean that this parameter has been unused for 25 years?

Maybe. I know that argument is not used since I started playing with sys.settrace. bdb is a very old module that no one touches for a long time. Also there are very few libraries in the market that actually use it.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AlexWaygood AlexWaygood merged commit 8e4fb5d into python:main Apr 29, 2024
@AlexWaygood AlexWaygood added the needs backport to 3.12 only security fixes label Apr 29, 2024
@miss-islington-app
Copy link

Thanks @gaogaotiantian for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 29, 2024
The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
(cherry picked from commit 8e4fb5d)

Co-authored-by: Tian Gao <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Apr 29, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Apr 29, 2024
@gaogaotiantian gaogaotiantian deleted the fix-bdb-docs branch April 29, 2024 21:01
AlexWaygood pushed a commit that referenced this pull request Apr 29, 2024
gh-118359: Improve docs for Bdb.user_call (GH-118368)

The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
(cherry picked from commit 8e4fb5d)

Co-authored-by: Tian Gao <[email protected]>
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
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 skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants