From 57281176cd2f57f8bb001c72a5800329106127ce Mon Sep 17 00:00:00 2001 From: George Ogden Date: Thu, 20 Nov 2025 21:46:16 +0000 Subject: [PATCH 1/4] Add section to operator.concat and operator.iconcat about dunder method --- Doc/library/operator.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index e8e71068dd99eb..7e599ab28affbc 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -220,6 +220,7 @@ Operations which work with sequences (some of them with mappings too) include: __concat__(a, b) Return ``a + b`` for *a* and *b* sequences. + Note: this calls ``__add__`` - there is no ``__concat__`` dunder method. .. function:: contains(a, b) @@ -519,6 +520,7 @@ will perform the update, so no subsequent assignment is necessary: __iconcat__(a, b) ``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences. + Note: this calls ``__iadd__`` - there is no ``__iconcat__`` dunder method. .. function:: ifloordiv(a, b) From 606eb6bf64044d62b1bd911ff4969498e2ab951d Mon Sep 17 00:00:00 2001 From: George Ogden Date: Mon, 24 Nov 2025 10:00:12 +0000 Subject: [PATCH 2/4] Make formatting more similar to not method --- Doc/library/operator.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 7e599ab28affbc..e5868268a90054 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -220,7 +220,8 @@ Operations which work with sequences (some of them with mappings too) include: __concat__(a, b) Return ``a + b`` for *a* and *b* sequences. - Note: this calls ``__add__`` - there is no ``__concat__`` dunder method. + (Note that there is no :meth:`!__concat__`. + Instead, the :meth:`~object.__add__` method is called.) .. function:: contains(a, b) @@ -520,7 +521,8 @@ will perform the update, so no subsequent assignment is necessary: __iconcat__(a, b) ``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences. - Note: this calls ``__iadd__`` - there is no ``__iconcat__`` dunder method. + (Note that there is no :meth:`!__iconcat__`. + Instead, the :meth:`~object.__iadd__` method is called.) .. function:: ifloordiv(a, b) From 61a1fd86099954cab3b41ca8d5909efeb7c3796b Mon Sep 17 00:00:00 2001 From: George Ogden Date: Mon, 24 Nov 2025 10:02:54 +0000 Subject: [PATCH 3/4] Add missed word 'method' --- Doc/library/operator.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index e5868268a90054..112f7efc6cfe15 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -220,7 +220,7 @@ Operations which work with sequences (some of them with mappings too) include: __concat__(a, b) Return ``a + b`` for *a* and *b* sequences. - (Note that there is no :meth:`!__concat__`. + (Note that there is no :meth:`!__concat__` method. Instead, the :meth:`~object.__add__` method is called.) @@ -521,7 +521,7 @@ will perform the update, so no subsequent assignment is necessary: __iconcat__(a, b) ``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences. - (Note that there is no :meth:`!__iconcat__`. + (Note that there is no :meth:`!__iconcat__` method. Instead, the :meth:`~object.__iadd__` method is called.) From e066e988b2538bca53d9d3029e24e9398fdd0e9b Mon Sep 17 00:00:00 2001 From: George Ogden Date: Mon, 24 Nov 2025 10:16:01 +0000 Subject: [PATCH 4/4] Remove trailing whitespace --- Doc/library/operator.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 112f7efc6cfe15..0070a5466ca6ca 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -220,7 +220,7 @@ Operations which work with sequences (some of them with mappings too) include: __concat__(a, b) Return ``a + b`` for *a* and *b* sequences. - (Note that there is no :meth:`!__concat__` method. + (Note that there is no :meth:`!__concat__` method. Instead, the :meth:`~object.__add__` method is called.) @@ -521,7 +521,7 @@ will perform the update, so no subsequent assignment is necessary: __iconcat__(a, b) ``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences. - (Note that there is no :meth:`!__iconcat__` method. + (Note that there is no :meth:`!__iconcat__` method. Instead, the :meth:`~object.__iadd__` method is called.)