From 39662459f87f933a533d44538bf8921418ab1be2 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 20 Aug 2025 23:55:47 -0400 Subject: [PATCH 1/3] gh-138011: Clarify tutorial method object example code x must be a MyClass instance for examples to work. --- 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 fa964271d79bd8..8d39c6deb3d927 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:: From ab916c63a71f05be11f98487267311f3a5a03be4 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 21 Aug 2025 00:06:33 -0400 Subject: [PATCH 2/3] Update Doc/tutorial/classes.rst --- 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 8d39c6deb3d927..6c63758db2f28e 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() -If `x = MyClass()`, as above, this will return the string ``'hello world'``. +If :source:`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:: From 43aa24141af1e3d6d57e936728d1869167775e7b Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 21 Aug 2025 10:53:45 -0400 Subject: [PATCH 3/3] Update Doc/tutorial/classes.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- 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 6c63758db2f28e..9ab003d5cd3dd5 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() -If :source:`x = MyClass()`, as above, 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::