Skip to content

Commit b489b76

Browse files
committed
Use the term "special method"
1 parent 5e4d1d9 commit b489b76

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Doc/reference/expressions.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,8 @@ Syntactically, these are all equivalent::
975975

976976
At runtime, the interpreter will evaluate the primary and
977977
the subscript, and call the primary's :meth:`~object.__getitem__` or
978-
:meth:`~object.__class_getitem__` method with the subscript as argument.
978+
:meth:`~object.__class_getitem__` :term:`special method` with the subscript
979+
as argument.
979980
For more details on which of these methods is called, see
980981
:ref:`classgetitem-versus-getitem`.
981982

@@ -999,8 +1000,8 @@ subscription.
9991000
Subscriptions may also be used as targets in :ref:`assignment <assignment>` or
10001001
:ref:`deletion <del>` statements.
10011002
In these cases, the interpreter will call the subscripted object's
1002-
:meth:`~object.__setitem__` or :meth:`~object.__delitem__` method,
1003-
respectively, instead of :meth:`~object.__getitem__`.
1003+
:meth:`~object.__setitem__` or :meth:`~object.__delitem__`
1004+
:term:`special method`, respectively, instead of :meth:`~object.__getitem__`.
10041005

10051006
.. code-block::
10061007
@@ -1063,7 +1064,7 @@ whose :attr:`~slice.start`, :attr:`~slice.stop` and
10631064
expressions between the colons.
10641065
Any missing expression evaluates to :const:`None`.
10651066
This :class:`!slice` object is then passed to the :meth:`~object.__getitem__`
1066-
or :meth:`~object.__class_getitem__` method, as above. ::
1067+
or :meth:`~object.__class_getitem__` :term:`special method`, as above. ::
10671068

10681069
# continuing with the SubscriptionDemo instance defined above:
10691070
>>> demo[2:3]
@@ -1088,7 +1089,7 @@ This form is commonly used with numerical libraries for slicing
10881089
multi-dimensional data.
10891090
In this case, the interpreter constructs a :class:`tuple` of the results of the
10901091
expressions or slices, and passes this tuple to the :meth:`~object.__getitem__`
1091-
or :meth:`~object.__class_getitem__` method, as above.
1092+
or :meth:`~object.__class_getitem__` :term:`special method`, as above.
10921093

10931094
The subscript may also be given as a single expression or slice followed
10941095
by a comma, to specify a one-element tuple::

0 commit comments

Comments
 (0)