Comparing dictionaries, is this valid Python?

Peter Hansen peter at engcorp.com
Tue Dec 13 20:43:12 EST 2005


François Pinard wrote:
> As for:
> 
>    http://www.python.org/doc/2.3.5/lib/comparisons.html
> 
> it only says "Comparison operations are supported by all objects", which 
> is a little vague, and no promise that comparisons are meaningful (for 
> example, one might wonder what would exactly mean the comparison of open 
> files).  

I'm not checking the 2.3.5 version, but that latest one is fairly clear 
on what comparisons on mappings do:

http://docs.python.org/ref/comparisons.html

The same behaviour applied to 2.3.5 though, I believe, so maybe that's 
sufficient for you.

-Peter




More information about the Python-list mailing list