In article <[EMAIL PROTECTED]>, John Machin <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> In article <[EMAIL PROTECTED]>, >> MonkeeSage <[EMAIL PROTECTED]> wrote: >>>On Oct 6, 6:27 pm, [EMAIL PROTECTED] (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 ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra -- http://mail.python.org/mailman/listinfo/python-list