backport bin() documentation
This commit is contained in:
parent
ab5f879022
commit
b5f8208b49
|
@ -112,6 +112,15 @@ available. They are listed here in alphabetical order.
|
|||
.. 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
|
||||
|
|
|
@ -629,10 +629,11 @@ definitions:
|
|||
|
||||
.. 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"
|
||||
|
|
Loading…
Reference in New Issue