Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 1 | \section{Built-in Constants} |
Skip Montanaro | 17804b1 | 2003-01-01 20:33:38 +0000 | [diff] [blame] | 2 | |
Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 3 | A small number of constants live in the built-in namespace. They are: |
Skip Montanaro | 17804b1 | 2003-01-01 20:33:38 +0000 | [diff] [blame] | 4 | |
| 5 | \begin{datadesc}{False} |
Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 6 | The false value of the \class{bool} type. |
| 7 | \versionadded{2.3} |
Skip Montanaro | 17804b1 | 2003-01-01 20:33:38 +0000 | [diff] [blame] | 8 | \end{datadesc} |
| 9 | |
| 10 | \begin{datadesc}{True} |
Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 11 | The true value of the \class{bool} type. |
| 12 | \versionadded{2.3} |
Skip Montanaro | 17804b1 | 2003-01-01 20:33:38 +0000 | [diff] [blame] | 13 | \end{datadesc} |
| 14 | |
| 15 | \begin{datadesc}{None} |
Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 16 | The sole value of \code{\refmodule{types}.NoneType}. \code{None} is |
| 17 | frequently used to represent the absence of a value, as when default |
| 18 | arguments are not passed to a function. |
Skip Montanaro | 17804b1 | 2003-01-01 20:33:38 +0000 | [diff] [blame] | 19 | \end{datadesc} |
| 20 | |
Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 21 | \begin{datadesc}{NotImplemented} |
| 22 | Special value which can be returned by the ``rich comparison'' |
| 23 | special methods (\method{__eq__()}, \method{__lt__()}, and friends), |
| 24 | to indicate that the comparison is not implemented with respect to |
| 25 | the other type. |
| 26 | \end{datadesc} |
| 27 | |
| 28 | \begin{datadesc}{Ellipsis} |
Georg Brandl | 52318d6 | 2006-09-06 07:06:08 +0000 | [diff] [blame^] | 29 | The same as \code{...}. |
| 30 | Special value used mostly in conjunction with extended slicing syntax |
| 31 | for user-defined container data types. |
Fred Drake | 74bcac4 | 2003-01-02 05:13:51 +0000 | [diff] [blame] | 32 | % XXX Someone who understands extended slicing should fill in here. |
| 33 | \end{datadesc} |