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

Raymond Hettinger python at rcn.com
Tue Apr 21 01:21:25 CEST 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