Skip to content

Conversation

@priyanshu2282-cyber
Copy link

@priyanshu2282-cyber priyanshu2282-cyber commented Jan 9, 2026

The PR clarifies the behavior of singledispatchmethod in the documentation. It always dispatches the first argument during call, regardless of whether the method is bound or unbound, as a result xf(a)!=c.f(x,a). The behavior is intentional and required to support correct dispatch for staticmethod and classmethod.


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

@python-cla-bot
Copy link

python-cla-bot bot commented Jan 9, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@neg.register
def _(self, arg: bool):
return not arg
.. note::
Copy link
Member

Choose a reason for hiding this comment

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

  1. Don't use a note.
  2. Put the paragraph after we mention the behavior of classmethod/staticmethod
  3. Don't write x.f(a) != C.f(x,a) it's confusing and ca be wrong.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the clarification, I will remove the note and describe the behaviour in paragraph format, in text. I will update the PR shortly.

@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2026

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@priyanshu2282-cyber
Copy link
Author

I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Jan 9, 2026

Thanks for making the requested changes!

@picnixz: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested a review from picnixz January 9, 2026 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants