dict1 < dict2 <=> len(dict1) <= len(dict2) ?

Tim Peters tim.one at comcast.net
Mon Oct 21 04:04:24 CEST 2002

> 2. Comparing a dict against an empty dict, as in
>      while dict > {}:

[Delaney, Timothy]
> Do people actually do that Tim? That's brain dead ...
>     while not dict:

No, *that's* brain dead <wink>.  What a normal person does is

    while dict:

Perhaps those who get burned by writing "not dict" instead feel that "dict >
{}" is clearer.  I haven't seen it often in any case.

More information about the Python-list mailing list