checking if a list is empty

rusi rustompmody at gmail.com
Sat May 14 22:41:32 EDT 2011


On May 15, 4:26 am, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> rusi <rustompm... at gmail.com> writes:
> > [Steven quote]
> > In Python, [1, 2, 3] is another way of writing true, and [] is another
> > way of writing false. Similarly with any other arbitrary objects. The
> > only things that bools True and False are good for are:
> > <snipped>
> > [end Steven quote]
> > ------------------------
>
> > So since
> > [1,2,3] is one way of writing True (lets call it True3)
>
> No. Steven knew exactly why he was using “true” versus “True”. He's
> explained why elsewhere in this thread. The former does not refer to the
> Python boolean singleton, the latter does.
>
> The only object that is True is the True singleton. But there are many
> objects that are true.

Yes.
The python entities: {True, False} are not an exact (isomorphic) model
for the semantic boolean domain {true, false} (which is needed for
example to explicate the semantics of if while etc)  Which is to say
the boolean type in python is not first class.



More information about the Python-list mailing list