@@ -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
@@ -1787,18 +1787,18 @@ Basic customization
17871787 ``x.__ne__(y) ``, ``x>y `` calls ``x.__gt__(y) ``, and ``x>=y `` calls
17881788 ``x.__ge__(y) ``.
17891789
1790- A rich comparison method may return the singleton `` NotImplemented ` ` if it does
1790+ A rich comparison method may return the singleton :data: ` NotImplemented ` if it does
17911791 not implement the operation for a given pair of arguments. By convention,
17921792 ``False `` and ``True `` are returned for a successful comparison. However, these
17931793 methods can return any value, so if the comparison operator is used in a Boolean
17941794 context (e.g., in the condition of an ``if `` statement), Python will call
17951795 :func: `bool ` on the value to determine if the result is true or false.
17961796
17971797 By default, ``object `` implements :meth: `__eq__ ` by using ``is ``, returning
1798- `` NotImplemented ` ` in the case of a false comparison:
1798+ :data: ` NotImplemented ` in the case of a false comparison:
17991799 ``True if x is y else NotImplemented ``. For :meth: `__ne__ `, by default it
18001800 delegates to :meth: `__eq__ ` and inverts the result unless it is
1801- `` NotImplemented ` `. There are no other implied relationships among the
1801+ :data: ` ! NotImplemented `. There are no other implied relationships among the
18021802 comparison operators or default implementations; for example, the truth of
18031803 ``(x<y or x==y) `` does not imply ``x<=y ``. To automatically generate ordering
18041804 operations from a single root operation, see :func: `functools.total_ordering `.
@@ -2828,7 +2828,7 @@ through the object's keys; for sequences, it should iterate through the values.
28282828 Called to implement :func: `operator.length_hint `. Should return an estimated
28292829 length for the object (which may be greater or less than the actual length).
28302830 The length must be an integer ``>= `` 0. The return value may also be
2831- :const : `NotImplemented `, which is treated the same as if the
2831+ :data : `NotImplemented `, which is treated the same as if the
28322832 ``__length_hint__ `` method didn't exist at all. This method is purely an
28332833 optimization and is never required for correctness.
28342834
@@ -2980,7 +2980,7 @@ left undefined.
29802980 function is to be supported.
29812981
29822982 If one of those methods does not support the operation with the supplied
2983- arguments, it should return `` NotImplemented ` `.
2983+ arguments, it should return :data: ` NotImplemented `.
29842984
29852985
29862986.. method :: object.__radd__(self, other)
@@ -3010,7 +3010,7 @@ left undefined.
30103010 types. [# ]_ For instance, to evaluate the expression ``x - y ``, where *y * is
30113011 an instance of a class that has an :meth: `__rsub__ ` method,
30123012 ``type(y).__rsub__(y, x) `` is called if ``type(x).__sub__(x, y) `` returns
3013- * NotImplemented * .
3013+ :data: ` NotImplemented ` .
30143014
30153015 .. index :: pair: built-in function; pow
30163016
@@ -3503,7 +3503,7 @@ An example of an asynchronous context manager class::
35033503 the behavior that ``None `` is not callable.
35043504
35053505 .. [# ] "Does not support" here means that the class has no such method, or
3506- the method returns `` NotImplemented ` `. Do not set the method to
3506+ the method returns :data: ` NotImplemented `. Do not set the method to
35073507 ``None `` if you want to force fallback to the right operand's reflected
35083508 method—that will instead have the opposite effect of explicitly
35093509 *blocking * such fallback.
0 commit comments