Skip to content

Commit 3966245

Browse files
committed
gh-138011: Clarify tutorial method object example code
x must be a MyClass instance for examples to work.
1 parent c056a08 commit 3966245

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)