Skip to content

Commit 645cef3

Browse files
author
Tyler Goodlet
committed
Note that self is ignored in hookimpl signatures
Resolves #128
1 parent 119836b commit 645cef3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,11 @@ whereas this is not:
451451
def myhook(config, args, extra_arg):
452452
print(args)
453453
454+
.. note::
455+
The one exception to this rule (that a *hookspec* must have as least as
456+
many arguments as its *hookimpls*) is the conventional `self`_ arg; this
457+
is always ignored when *hookimpls* are defined as `methods`_.
458+
454459
.. _firstresult:
455460

456461
First result only
@@ -823,6 +828,10 @@ in your project you should thus use a dependency restriction like
823828
https://github.com/pytest-dev/pluggy/blob/master/tox.ini#L2
824829
.. _200+ plugins:
825830
http://plugincompat.herokuapp.com/
831+
.. _self:
832+
https://docs.python.org/3.6/tutorial/classes.html#random-remarks
833+
.. _methods:
834+
https://docs.python.org/3.6/tutorial/classes.html#method-objects
826835

827836

828837
.. Indices and tables

0 commit comments

Comments
 (0)