Kaydet (Commit) 3214a01d authored tarafından Georg Brandl's avatar Georg Brandl

#1410739: add a footnote about "is" and "unusual" behavior.

üst 1e0eefc4
...@@ -1113,7 +1113,7 @@ The operator :keyword:`not in` is defined to have the inverse true value of ...@@ -1113,7 +1113,7 @@ The operator :keyword:`not in` is defined to have the inverse true value of
The operators :keyword:`is` and :keyword:`is not` test for object identity: ``x The operators :keyword:`is` and :keyword:`is not` test for object identity: ``x
is y`` is true if and only if *x* and *y* are the same object. ``x is not y`` is y`` is true if and only if *x* and *y* are the same object. ``x is not y``
yields the inverse truth value. yields the inverse truth value. [#]_
.. _booleans: .. _booleans:
...@@ -1352,3 +1352,7 @@ groups from right to left). ...@@ -1352,3 +1352,7 @@ groups from right to left).
only, but this caused surprises because people expected to be able to test a only, but this caused surprises because people expected to be able to test a
dictionary for emptiness by comparing it to ``{}``. dictionary for emptiness by comparing it to ``{}``.
.. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of
descriptors, you may notice seemingly unusual behaviour in certain uses of
the :keyword:`is` operator, like those involving comparisons between instance
methods, or constants. Check their documentation for more info.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment