[Python-ideas] Fwd: Why do equality tests between OrderedDict keys/values views behave not as expected?

Sven R. Kunze srkunze at mail.de
Fri Dec 18 17:03:13 EST 2015


On 18.12.2015 20:58, Andrew Barnert via Python-ideas wrote:
> If you're thinking we could define what multisets should do, despite 
> not having a standard multiset type or an ABC for them, and apply that 
> to values views, the next question is how to do that in better than 
> quadratic time for non-hashable values. (And you can't assume ordering 
> here, either.) Would having a values view hang for 30 seconds and then 
> come back with the answer you intuitively wanted instead of giving the 
> wrong answer in 20 millis be an improvement? (Either way, you're going 
> to learn the same lesson: don't compare values views. I'd rather learn 
> that in 20 millis.)

I like the multiset/bag idea.

Python calls them Counter, right?


Best,
Sven


More information about the Python-ideas mailing list