Names changed to protect the guilty

Aahz aahz at pythoncraft.com
Sat Oct 7 16:14:38 CEST 2006


In article <1160201214.367444.250270 at i42g2000cwa.googlegroups.com>,
John Machin <sjmachin at lexicon.net> wrote:
>Aahz wrote:
>> In article <1160182951.812677.178750 at i42g2000cwa.googlegroups.com>,
>> MonkeeSage <MonkeeSage at gmail.com> wrote:
>>>On Oct 6, 6:27 pm, a... at pythoncraft.com (Aahz) wrote:
>>>>
>>>> The following line of lightly munged code was found in a publicly
>>>> available Python library...
>>>
>>>Yes, this violates the Holy, Inspired, Infallible Style Guide (pbuh),
>>>which was written by the very finger of God when the world was still in
>>>chaotic darkness.
>>
>> Did you actually analyze the line of code?  Particularly WRT the way it
>> operates in different versions of Python?
>
>A comment on the "style" issue, before we get into the real WTF
>analysis: any function/method whose name begins with "has" or "is"
>returns an honest-to-goodness actual bool (or what passed for one in
>former times). IMHO, any comparison with [] being regarded as false and
>[0] being regarded as true is irrelevant, and writing "has_something()
>== False" or "has_something() is False" is utterly ludicrous.

Exactly.  Another way of putting this: it's so wrong, it isn't even
wrong.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra



More information about the Python-list mailing list