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

Guido van Rossum guido at python.org
Wed Oct 8 06:00:46 CEST 2014


On Tue, Oct 7, 2014 at 8:54 PM, <random832 at fastmail.us> wrote:

> On Tue, Oct 7, 2014, at 21:09, Stephen J. Turnbull wrote:
> > But this requires a comparison of the two orders, and "ordering
> > relation" is not a type available in the stdlib.
>
> This has nothing to do with comparable types - the only comparison being
> done on the members themselves is equality.
>
> i.e. if the main sequence is [5, 1, 3, 2, 4], it's true for [5, 2, 4]
> but not [5, 4, 1].
>
> Think of it as being the question of whether "51234" matches "5.*2.*4"
> (it does) or "5.*4.*1" (it does not). But if the argument is a set
> instead he wants it to be whether it's a subset rather than a
> subsequence.
>

This is the first understandable description of Ram's use case that I have
seen. Thank you!

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141007/cf9907d8/attachment.html>


More information about the Python-ideas mailing list