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

Guido van Rossum guido at python.org
Tue Oct 7 22:20:17 CEST 2014


But your use case (as I understand it) requires that the iteration order is
the same as the canonical order that your app defines.

On Tue, Oct 7, 2014 at 1:13 PM, Ram Rachum <ram at rachum.com> wrote:

> You're right, I didn't think of that case. So the best definition I can
> come up with is: "The iteration order is defined and meaningful, and not
> random." Is this specific enough? I know it's something which isn't
> testable programmatically (same as `tuple(x) == tuple(x)` which is
> impractical to test.)
>
>
> On Tue, Oct 7, 2014 at 11:10 PM, Alexander Belopolsky <
> alexander.belopolsky at gmail.com> wrote:
>
>>
>> On Tue, Oct 7, 2014 at 4:01 PM, Ram Rachum <ram at rachum.com> wrote:
>>
>>> you asked for the meaning of when something is ordered. Ed answered
>>> something and I said I meant exactly what he said, but maybe I should have
>>> been more explicit: I meant that it's guaranteed that `tuple(x) ==
>>> tuple(x)`.
>>
>>
>> I don't think this is a very useful definition:
>>
>> >>> x = iter('abc')
>> >>> tuple(x) == tuple(x)
>> False
>> >>> x = set('abc')
>> >>> tuple(x) == tuple(x)
>> True
>>
>>
>>
>


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


More information about the Python-ideas mailing list