Skip to content
5 changes: 5 additions & 0 deletions Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,11 @@ The :mod:`functools` module defines the following functions:
The same pattern can be used for other similar decorators:
:deco:`staticmethod`, :deco:`~abc.abstractmethod`, and others.

For every ``singledispatchmethod`` method defined in a class, the value
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't define a singledispatchmethod, you decorate one with this decorator. See the other paragraphs.

Copy link
Copy Markdown
Member

@johnslavik johnslavik Jan 13, 2026

Choose a reason for hiding this comment

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

You don't define a singledispatchmethod

It doesn't say singledispatchmethod defined in a class, but singledispatchmethod method defined in a class.

However, I agree that the current wording can be better. If it was good, you wouldn't have raised the thread.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your clarification, I have used the decorators as suggested, and updated the PR.

dispatched on by that method is *always* the first argument passed for the call.
Therefore, dispatching to regular methods can only be sensibly performed by
calling such a method from instances of the class, and not from the class object.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Align your paragraph with the other paragraphs, that is, use the correct indentation. You're 1 space off.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, Aligned!


.. versionadded:: 3.8

.. versionchanged:: 3.15
Expand Down
Loading