@@ -159,7 +159,7 @@ NotImplemented
159159.. index :: pair: object; NotImplemented
160160
161161This type has a single value. There is a single object with this value. This
162- object is accessed through the built-in name `` NotImplemented ` `. Numeric methods
162+ object is accessed through the built-in name :data: ` NotImplemented `. Numeric methods
163163and rich comparison methods should return this value if they do not implement the
164164operation for the operands provided. (The interpreter will then try the
165165reflected operation, or some other fallback, depending on the operator.) It
170170for more details.
171171
172172.. versionchanged :: 3.9
173- Evaluating `` NotImplemented ` ` in a boolean context is deprecated. While
173+ Evaluating :data: ` NotImplemented ` in a boolean context is deprecated. While
174174 it currently evaluates as true, it will emit a :exc: `DeprecationWarning `.
175175 It will raise a :exc: `TypeError ` in a future version of Python.
176176
@@ -1763,18 +1763,18 @@ Basic customization
17631763 ``x.__ne__(y) ``, ``x>y `` calls ``x.__gt__(y) ``, and ``x>=y `` calls
17641764 ``x.__ge__(y) ``.
17651765
1766- A rich comparison method may return the singleton `` NotImplemented ` ` if it does
1766+ A rich comparison method may return the singleton :data: ` NotImplemented ` if it does
17671767 not implement the operation for a given pair of arguments. By convention,
17681768 ``False `` and ``True `` are returned for a successful comparison. However, these
17691769 methods can return any value, so if the comparison operator is used in a Boolean
17701770 context (e.g., in the condition of an ``if `` statement), Python will call
17711771 :func: `bool ` on the value to determine if the result is true or false.
17721772
17731773 By default, ``object `` implements :meth: `__eq__ ` by using ``is ``, returning
1774- `` NotImplemented ` ` in the case of a false comparison:
1774+ :data: ` NotImplemented ` in the case of a false comparison:
17751775 ``True if x is y else NotImplemented ``. For :meth: `__ne__ `, by default it
17761776 delegates to :meth: `__eq__ ` and inverts the result unless it is
1777- `` NotImplemented ` `. There are no other implied relationships among the
1777+ :data: ` ! NotImplemented `. There are no other implied relationships among the
17781778 comparison operators or default implementations; for example, the truth of
17791779 ``(x<y or x==y) `` does not imply ``x<=y ``. To automatically generate ordering
17801780 operations from a single root operation, see :func: `functools.total_ordering `.
@@ -2800,7 +2800,7 @@ through the object's keys; for sequences, it should iterate through the values.
28002800 Called to implement :func: `operator.length_hint `. Should return an estimated
28012801 length for the object (which may be greater or less than the actual length).
28022802 The length must be an integer ``>= `` 0. The return value may also be
2803- :const : `NotImplemented `, which is treated the same as if the
2803+ :data : `NotImplemented `, which is treated the same as if the
28042804 ``__length_hint__ `` method didn't exist at all. This method is purely an
28052805 optimization and is never required for correctness.
28062806
@@ -2952,7 +2952,7 @@ left undefined.
29522952 function is to be supported.
29532953
29542954 If one of those methods does not support the operation with the supplied
2955- arguments, it should return `` NotImplemented ` `.
2955+ arguments, it should return :data: ` NotImplemented `.
29562956
29572957
29582958.. method :: object.__radd__(self, other)
@@ -2982,7 +2982,7 @@ left undefined.
29822982 types. [# ]_ For instance, to evaluate the expression ``x - y ``, where *y * is
29832983 an instance of a class that has an :meth: `__rsub__ ` method,
29842984 ``type(y).__rsub__(y, x) `` is called if ``type(x).__sub__(x, y) `` returns
2985- * NotImplemented * .
2985+ :data: ` NotImplemented ` .
29862986
29872987 .. index :: pair: built-in function; pow
29882988
@@ -3428,7 +3428,7 @@ An example of an asynchronous context manager class::
34283428 the behavior that ``None `` is not callable.
34293429
34303430 .. [# ] "Does not support" here means that the class has no such method, or
3431- the method returns `` NotImplemented ` `. Do not set the method to
3431+ the method returns :data: ` NotImplemented `. Do not set the method to
34323432 ``None `` if you want to force fallback to the right operand's reflected
34333433 method—that will instead have the opposite effect of explicitly
34343434 *blocking * such fallback.
0 commit comments