]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-138011: Clarify tutorial method object example code (GH-138014) (#138025)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 27 Aug 2025 13:59:47 +0000 (15:59 +0200)
committerGitHub <noreply@github.com>
Wed, 27 Aug 2025 13:59:47 +0000 (16:59 +0300)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Doc/tutorial/classes.rst

index 9d0fab8861d2a96ff8e6600f0807651845ab1d4d..645acdf20fb580f02efec62ef584a83e84234e81 100644 (file)
@@ -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::