Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,12 @@ calls are unexciting::

>>> class E(object):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that we can omit (object)

... def f(x):
... print(x)
... return x
... f = staticmethod(f)
...
>>> print(E.f(3))
>>> E.f(3)
3
>>> print(E().f(3))
>>> E().f(3)
3

Using the non-data descriptor protocol, a pure Python version of
Expand All @@ -398,9 +398,9 @@ for whether the caller is an object or a class::
... return klass.__name__, x
... f = classmethod(f)
...
>>> print(E.f(3))
>>> E.f(3)
('E', 3)
>>> print(E().f(3))
>>> E().f(3)
('E', 3)


Expand Down