Expression can be simplified on list

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Tue Sep 13 22:16:56 EDT 2016


On Tuesday, September 13, 2016 at 2:33:40 PM UTC+12, Ned Batchelder wrote:
> Why do you object to the type conversion to bool?

It would be better if all such conversions were explicit, e.g.

    if bool(«non-bool expr») :
    if not bool(«non-bool expr») :

instead of

    if «non-bool expr» :
    if not «non-bool expr» :



More information about the Python-list mailing list