and [True,True] --> [True, True]?????

Raymond Hettinger python at rcn.com
Mon Apr 20 19:21:25 EDT 2009


> > No. Tests like
>
> > if items:
> >    ...
>
> > to verify that items is a non-empty list are a widespread idiom in Python.
> > They rely on the behaviour you observe.
>
> Are they widespread? I haven't noticed, yet.

It's the preferred form (as recommended by PEP 8).


Raymond



More information about the Python-list mailing list