From 95189018ab1d13dcaabc5e4997e96b66c4769237 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Fri, 17 May 2024 22:46:57 +0200 Subject: [PATCH 1/6] Clarify classes tutorial --- Doc/tutorial/classes.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 7ab528acb370f2..2226c41c41533d 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -337,12 +337,11 @@ code will print the value ``16``, without leaving a trace:: print(x.counter) del x.counter -The other kind of instance attribute reference is a *method*. A method is a -function that "belongs to" an object. (In Python, the term method is not unique -to class instances: other object types can have methods as well. For example, -list objects have methods called append, insert, remove, sort, and so on. -However, in the following discussion, we'll use the term method exclusively to -mean methods of class instance objects, unless explicitly stated otherwise.) +The other kind of instance attribute reference is a method. In the following +discussion, we’ll use the term method exclusively to mean methods of class +instance objects, unless explicitly stated otherwise. (In other words, we are +not referring to built-in methods such as alist.append where alist is a list +object.) .. index:: pair: object; method From 66eb6594e2743e75dab25c9709fc3ad2d0f4e639 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Fri, 17 May 2024 22:48:15 +0200 Subject: [PATCH 2/6] Restore formatting --- 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 2226c41c41533d..16744008c266aa 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -337,7 +337,7 @@ code will print the value ``16``, without leaving a trace:: print(x.counter) del x.counter -The other kind of instance attribute reference is a method. In the following +The other kind of instance attribute reference is a *method*. In the following discussion, we’ll use the term method exclusively to mean methods of class instance objects, unless explicitly stated otherwise. (In other words, we are not referring to built-in methods such as alist.append where alist is a list From 44c902f5d8fe093de15b3e2026bd86d8ed1a1adb Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Sat, 18 May 2024 21:07:17 +0200 Subject: [PATCH 3/6] Update Doc/tutorial/classes.rst Co-authored-by: Pieter Eendebak --- 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 16744008c266aa..f25db52231acdd 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -340,7 +340,7 @@ code will print the value ``16``, without leaving a trace:: The other kind of instance attribute reference is a *method*. In the following discussion, we’ll use the term method exclusively to mean methods of class instance objects, unless explicitly stated otherwise. (In other words, we are -not referring to built-in methods such as alist.append where alist is a list +not referring to built-in methods such as :meth:`alist.append` where ``alist`` is a :class:`list` object.) .. index:: pair: object; method From 63a2f3b2ec8b5bd61d3e7d30c7ea892798ac1c34 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Sat, 18 May 2024 21:08:12 +0200 Subject: [PATCH 4/6] Update Doc/tutorial/classes.rst --- Doc/tutorial/classes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index f25db52231acdd..097b96c9dcd3c8 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -340,8 +340,8 @@ code will print the value ``16``, without leaving a trace:: The other kind of instance attribute reference is a *method*. In the following discussion, we’ll use the term method exclusively to mean methods of class instance objects, unless explicitly stated otherwise. (In other words, we are -not referring to built-in methods such as :meth:`alist.append` where ``alist`` is a :class:`list` -object.) +not referring to built-in methods such as :meth:`alist.append` where ``alist`` +is a :class:`list` object.) .. index:: pair: object; method From b6f45695e5ef6c3d81102c90f12bfde216497656 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Sat, 18 May 2024 21:32:20 +0200 Subject: [PATCH 5/6] Update Doc/tutorial/classes.rst --- Doc/tutorial/classes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 097b96c9dcd3c8..ac2fcdf1b6f799 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -340,8 +340,8 @@ code will print the value ``16``, without leaving a trace:: The other kind of instance attribute reference is a *method*. In the following discussion, we’ll use the term method exclusively to mean methods of class instance objects, unless explicitly stated otherwise. (In other words, we are -not referring to built-in methods such as :meth:`alist.append` where ``alist`` -is a :class:`list` object.) +not referring to built-in methods such as ``alist.append`` where ``alist`` is +a :class:`list` object.) .. index:: pair: object; method From 13773385ebfbe14f5fe8aaca04ad7281b483f316 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Sat, 1 Jun 2024 22:57:36 +0200 Subject: [PATCH 6/6] Update Doc/tutorial/classes.rst Co-authored-by: Alex Waygood --- Doc/tutorial/classes.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index ac2fcdf1b6f799..1b64741c349ee9 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -337,11 +337,8 @@ code will print the value ``16``, without leaving a trace:: print(x.counter) del x.counter -The other kind of instance attribute reference is a *method*. In the following -discussion, we’ll use the term method exclusively to mean methods of class -instance objects, unless explicitly stated otherwise. (In other words, we are -not referring to built-in methods such as ``alist.append`` where ``alist`` is -a :class:`list` object.) +The other kind of instance attribute reference is a *method*. A method is a +function that "belongs to" an object. .. index:: pair: object; method