Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | |
| 2 | Built-in Constants |
| 3 | ================== |
| 4 | |
| 5 | A small number of constants live in the built-in namespace. They are: |
| 6 | |
| 7 | |
Georg Brandl | 55ac8f0 | 2007-09-01 13:51:09 +0000 | [diff] [blame] | 8 | .. XXX False, True, None are keywords too |
| 9 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 10 | .. data:: False |
| 11 | |
| 12 | The false value of the :class:`bool` type. |
| 13 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 14 | |
| 15 | .. data:: True |
| 16 | |
| 17 | The true value of the :class:`bool` type. |
| 18 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 19 | |
| 20 | .. data:: None |
| 21 | |
| 22 | The sole value of :attr:`types.NoneType`. ``None`` is frequently used to |
| 23 | represent the absence of a value, as when default arguments are not passed to a |
| 24 | function. |
| 25 | |
| 26 | |
| 27 | .. data:: NotImplemented |
| 28 | |
| 29 | Special value which can be returned by the "rich comparison" special methods |
| 30 | (:meth:`__eq__`, :meth:`__lt__`, and friends), to indicate that the comparison |
| 31 | is not implemented with respect to the other type. |
| 32 | |
| 33 | |
| 34 | .. data:: Ellipsis |
| 35 | |
| 36 | The same as ``...``. Special value used mostly in conjunction with extended |
| 37 | slicing syntax for user-defined container data types. |
| 38 | |
| 39 | .. % XXX Someone who understands extended slicing should fill in here. |
| 40 | |