[bind10-dev] Python style micro-nit

Shane Kerr shane at isc.org
Tue Jun 29 17:35:20 UTC 2010


Something came up in a recent review that Jelte did on some of my code,
and I'd like to see if there are any preferences.

In Python you can say:

    if foo is not None:
    if bar not in baz:

You can also say:

    if not foo is None:
    if not bar in baz:

Jelte prefers the first style. I have no preference, although I did mix
them in my code and that's probably a bad thing (although with deep
thinking one could pick times when it was more important to put the
"not" first as it was closer to the meaning of the condition, and times
when it was important to put the "not" later).

Any other preferences? Is this important enough to even document?


More information about the bind10-dev mailing list