Anonymous avatar Anonymous committed 776a013

Addd a few cross-references.
Clarified the short-circuit behavior of or and and.

Comments (0)

Files changed (1)

Doc-26/library/stdtypes.rst

 
    Historically (until release 2.2), Python's built-in types have differed from
    user-defined types because it was not possible to use the built-in types as the
-   basis for object-oriented inheritance. This limitation does not exist any
-   longer.
+   basis for object-oriented inheritance. This limitation no longer
+   exists.
 
 .. index:: pair: built-in; types
 
 | ``x or y``  | if *x* is false, then *y*, else | \(1)  |
 |             | *x*                             |       |
 +-------------+---------------------------------+-------+
-| ``x and y`` | if *x* is false, then *x*, else | \(1)  |
+| ``x and y`` | if *x* is false, then *x*, else | \(2)  |
 |             | *y*                             |       |
 +-------------+---------------------------------+-------+
-| ``not x``   | if *x* is false, then ``True``, | \(2)  |
+| ``not x``   | if *x* is false, then ``True``, | \(3)  |
 |             | else ``False``                  |       |
 +-------------+---------------------------------+-------+
 
 Notes:
 
 (1)
-   These only evaluate their second argument if needed for their outcome.
+   This is a short-circuit operator, so it only evaluates the second
+   argument if the first one is :const:`False`.
 
 (2)
+   This is a short-circuit operator, so it only evaluates the second
+   argument if the first one is :const:`True`.
+
+(3)
    ``not`` has a lower priority than non-Boolean operators, so ``not a == b`` is
    interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error.
 
 +------------+-------------------------+-------+
 | ``!=``     | not equal               | \(1)  |
 +------------+-------------------------+-------+
-| ``<>``     | not equal               | \(1)  |
-+------------+-------------------------+-------+
 | ``is``     | object identity         |       |
 +------------+-------------------------+-------+
 | ``is not`` | negated object identity |       |
 Notes:
 
 (1)
-   ``<>`` and ``!=`` are alternate spellings for the same operator. ``!=`` is the
-   preferred spelling; ``<>`` is obsolescent.
+    ``!=`` can also be written ``<>``, but this is an obsolete usage
+    kept for backwards compatibility only. New code should always use
+    ``!=``.
 
 .. index::
    pair: object; numeric
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.