[Python-ideas] issubclass(collections.OrderedDict, collections.Sequence)

Serhiy Storchaka storchaka at gmail.com
Mon Oct 6 14:02:03 CEST 2014


On 06.10.14 02:15, Guido van Rossum wrote:
> But what kind of use could a program make of this? The only things I can
> think of would have to be combined with some other specific container
> type that isn't always ordered (Sequence is ordered, Set and Mapping
> aren't). I can think of plenty of situations where it would be useful to
> say "use an OrderedDict, otherwise X will happen", but I can't think of
> a case where I could say "use any container type you like as long as it
> is Ordered".
>
> What was your use case? Do you have one? Or are you just interested in
> asking questions?

There is one use case. When output a set or mapping in human readable 
way, it is handy to sort them by elements or keys. Except when it is a 
sequence or OrderedDict.

This is very specific use case however.



More information about the Python-ideas mailing list