Comparisons and sorting of a numeric class....

Marko Rauhamaa marko at pacujo.net
Wed Jan 7 05:01:34 EST 2015


Steven D'Aprano <steve at pearwood.info>:

> int 0 is a falsey object
> NoneType None is a falsey object
> str 'hello' is a truthy object
> float 23.0 is a truthy object

I prefer the Scheme way:

   #f is a falsey object

   everything else is a truthy object


Marko



More information about the Python-list mailing list