From 8773e55f379f54093af12159f3ebb16fb6db5dd1 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 21 Aug 2025 11:02:29 -0400 Subject: [PATCH] gh-138011: Clarify tutorial method object example code (GH-138014) x must be a MyClass instance for examples to work. --------- Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> (cherry picked from commit 339f5da6395868073e22157424405b89cafb5c6d) Co-authored-by: Terry Jan Reedy --- Doc/tutorial/classes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 9d0fab8861d2a9..645acdf20fb580 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -359,7 +359,7 @@ Usually, a method is called right after it is bound:: x.f() -In the :class:`!MyClass` example, this will return the string ``'hello world'``. +If ``x = MyClass()``, as above, this will return the string ``'hello world'``. However, it is not necessary to call a method right away: ``x.f`` is a method object, and can be stored away and called at a later time. For example::