Coding style

Carl Banks pavlovevidence at gmail.com
Tue Jul 18 19:25:47 EDT 2006


Bruno Desthuilliers wrote:
> "Irrelevant" may not be the best expression of my thought here - it's
> just that Carl's assertion is kind of a tautology and doesn't add
> anything to the discussion. If Python had been designed as statically
> typed (with declarative typing), the rules would be different. Yeah,
> great. And now ?

I was answering someone who said you should use "if lst" because PEP 8
says to.  I proposed that the PEP might be outdated here, and gave
reasons why I think it would be different if it were written today.  (I
also, regrettably, implied the language might have been designed
differently.)  This all might be irrelevant to you, but it's relevant
to the original question of whether that clause of PEP 8 is outdated.
I think it is.

BTW, I'm still waiting for anyone to come up with a real benefit of the
"if lst" test.  I have yet to see a good reason than non-answer
cop-outs "it's Pythonic", "it's stood the test of time", and "it's in
PEP 8".  "It's standard idiom" is about the best I've seen, and that's
pretty weak.  "Saving a few keystrokes" is, as always, not a good
reason.


Carl Banks




More information about the Python-list mailing list