Skip to content

Commit 339f5da

Browse files
gh-138011: Clarify tutorial method object example code (#138014)
x must be a MyClass instance for examples to work. --------- Co-authored-by: Stan Ulbrych <[email protected]>
1 parent 9f05f98 commit 339f5da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/tutorial/classes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ Usually, a method is called right after it is bound::
359359

360360
x.f()
361361

362-
In the :class:`!MyClass` example, this will return the string ``'hello world'``.
362+
If ``x = MyClass()``, as above, this will return the string ``'hello world'``.
363363
However, it is not necessary to call a method right away: ``x.f`` is a method
364364
object, and can be stored away and called at a later time. For example::
365365

0 commit comments

Comments
 (0)