Coding style

Bruno Desthuilliers onurb at xiludom.gro
Tue Jul 18 04:45:47 EDT 2006


tac-tics wrote:
>>Or even just:
>>
>>lst = []
>>
>>;-)
> 
> 
> Indeed.
> 
> I'd say the second one. 

And you'd be plain wrong.

> Empty lists are not false.

In a bolean context, empty containers (lists, tuples, dicts, sets etc),
empty strings, integer 0, float 0.0 and None are all false. This is part
of the language specs.

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list