r67060 - in python/trunk/Doc: library/functions.rst reference/lexical_analysis.rst
Author: benjamin.peterson Date: Thu Oct 30 23:39:25 2008 New Revision: 67060 Log: backport bin() documentation Modified: python/trunk/Doc/library/functions.rst python/trunk/Doc/reference/lexical_analysis.rst Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Thu Oct 30 23:39:25 2008 @@ -112,6 +112,15 @@ .. versionadded:: 2.3 +.. function:: bin(x) + + Convert an integer number to a binary string. The result is a valid Python + expression. If *x* is not a Python :class:`int` object, it has to define an + :meth:`__index__` method that returns an integer. + + .. versionadded:: 2.6 + + .. function:: bool([x]) Convert a value to a Boolean, using the standard truth testing procedure. If Modified: python/trunk/Doc/reference/lexical_analysis.rst ============================================================================== --- python/trunk/Doc/reference/lexical_analysis.rst (original) +++ python/trunk/Doc/reference/lexical_analysis.rst Thu Oct 30 23:39:25 2008 @@ -629,10 +629,11 @@ .. productionlist:: longinteger: `integer` ("l" | "L") - integer: `decimalinteger` | `octinteger` | `hexinteger` + integer: `decimalinteger` | `octinteger` | `hexinteger` | `bininteger` decimalinteger: `nonzerodigit` `digit`* | "0" octinteger: "0" `octdigit`+ hexinteger: "0" ("x" | "X") `hexdigit`+ + bininteger: "0" ("b" | "B") `bindigit`+ nonzerodigit: "1"..."9" octdigit: "0"..."7" hexdigit: `digit` | "a"..."f" | "A"..."F"
participants (1)
-
benjamin.peterson