[Python-ideas] Programming recommendations (PEP 8) and boolean values

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Aug 9 03:43:30 CEST 2012

On Wed, Aug 8, 2012 at 9:20 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> Yes, this is documented:
> http://docs.python.org/py3k/library/functions.html#bool

Indeed.  I was actually looking under "Built-in Types",
<http://docs.python.org/py3k/library/stdtypes.html> rather than
"Built-in Functions."  I now remember that I noted this issue before.
This part of the manual is not optimally subdivided into sections:

2. Built-in Functions
   (covers bool() and other builtin type constructors)
3. Built-in Constants
   (covers True and False)
4. Built-in Types
4.1. Truth Value Testing
4.2. Boolean Operations — and, or, not
4.3. Comparisons
4.4. Numeric Types — int, float, complex

As a result, there is no one place where one can find information
about bool.  I wonder if it should go somewhere under section 4.4.
After all,

 >>> isinstance(True, int)

More information about the Python-ideas mailing list