[Python-checkins] r67060 - in python/trunk/Doc: library/functions.rst reference/lexical_analysis.rst
benjamin.peterson
python-checkins at python.org
Fri Oct 31 00:47:51 CET 2008
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"
More information about the Python-checkins
mailing list