On 2007-10-19, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Oct 19, 1:44 am, MRAB <[EMAIL PROTECTED]> wrote:
>> On Oct 18, 7:05 am, Michele Simionato <[EMAIL PROTECTED]>
>>
>>     if number == 0:
>>         return "0"
>>
>
> Hey,
>
> Isn't
> if not number:
>   return "0"
>
> faster?

Depends on who is parsing it.

If a computer, possibly a few micro-seconds (if the Python byte-code generator
doesn't optimize it away).

If a human, then it is slower by at least a second.


Since I prefer to optimize on my time rather than CPU time, I'd prefer the
first version

Albert
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to