<div dir="ltr">Ah, perhaps I haven't explained clearly enough.<div><br></div><div>I did not mean that the result of `isinstance(x, Ordered)` would be somehow determined by the canonical order in my combinatorics package (which would be absurd as my package is just my own thing and shouldn't affect a type in `collections`). I meant that my combinatorics package, when asked whether a certain iterable belongs in a combination space, would check its order only if the iterable type is `Ordered`. (i.e. it's communicating "my order is meaningful".)</div><div><br></div><div>For example, someone could have a combination space "3 items taken from range(5)", which has members like (0, 1, 2) and (1, 3, 4), but not (4, 2, 1) because it's not in canoncial order. If someone were to check `(4, 2, 1) in comb_space` he should get `False`, but if he's checking `{1, 2, 4} in comb_space` he should get `True`, regardless of iteration order, because it's a `set` which isn't supposed to be ordered so it's assumed the user is not asking a question about order.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 11:20 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=guido@python.org&cc=&bcc=&su=&body=','_blank');return false;">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">But your use case (as I understand it) requires that the iteration order is the same as the canonical order that your app defines.<br></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 1:13 PM, Ram Rachum <span dir="ltr"><<a href="mailto:ram@rachum.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=ram@rachum.com&cc=&bcc=&su=&body=','_blank');return false;">ram@rachum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.)<div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 11:10 PM, Alexander Belopolsky <span dir="ltr"><<a href="mailto:alexander.belopolsky@gmail.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=alexander.belopolsky@gmail.com&cc=&bcc=&su=&body=','_blank');return false;">alexander.belopolsky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span><br><div class="gmail_quote">On Tue, Oct 7, 2014 at 4:01 PM, Ram Rachum <span dir="ltr"><<a href="mailto:ram@rachum.com" target="_blank" onclick="window.open('https://mail.google.com/mail/?view=cm&tf=1&to=ram@rachum.com&cc=&bcc=&su=&body=','_blank');return false;">ram@rachum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">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)`.</blockquote></div><div class="gmail_extra"><br></div></span><div class="gmail_extra">I don't think this is a very useful definition:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">>>> x = iter('abc')</div><div class="gmail_extra">>>> tuple(x) == tuple(x)</div><div class="gmail_extra">False</div><div class="gmail_extra"><div class="gmail_extra">>>> x = set('abc')</div><div class="gmail_extra">>>> tuple(x) == tuple(x)</div><div class="gmail_extra">True</div><div class="gmail_extra"><br></div></div></div><br></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br><br clear="all"><br></div></div><span class="">-- <br>--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)
</span></div>
</blockquote></div><br></div></div>