Coding style in CPython implementation

Chris Angelico rosuav at gmail.com
Sun Oct 29 14:24:35 EDT 2017


On Mon, Oct 30, 2017 at 12:47 AM, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> =?UTF-8?B?zqPPhM6tz4bOsc69zr/PgiDOo8+Jz4bPgc6/zr3Or86/z4U=?= <stefanossofroniou542 at gmail.com> writes:
>>I guess the following parts from "Zen of Python" apply to this case:
>
>   If we would agree to apply Python rules to C,
>   then we could also use this excerpt from PEP 8:
>
> |o Don't compare boolean values to True or False using ==.
> |
> |Yes:   if greeting:
> |No:    if greeting == True:
> |Worse: if greeting is True:

Or if we could agree to read PEP 7, there might be an example in
there. Granted, it might not be an explicit recommendation, merely a
tangential reference in a paragraph about braces, but it could be
indicative.

ChrisA



More information about the Python-list mailing list