[Python-Dev] Re: Comparing dict.values()

2019年7月24日 09:46:09 -0700

On 2019年7月23日 23:44:35 +0100
MRAB <[email protected]> wrote:
> 
> However, when comparing the values you have a problem: you have 2 
> collections of objects that might contain duplicates, might not be 
> hashable, and might not be sortable, so comparing them could be 
> inefficient, and you can't refer back to their keys like in the case of 
> comparing the items as above because the 2 dicts might have different 
> keys. Unless someone can come up with an efficient solution, I'd 
> probably go with raising an exception.
Equality comparisons should never raise.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/KNYYAVFME5ADN4UKMEW2TNHHZ4BGPSXG/

Reply via email to