On Fri, Jul 3, 2020, at 03:57, Wes Turner wrote:
> Can a Sequence be infinite? If so, an equality test of two 
> nonterminating sequences would be a nonterminating operation.

I think not - an infinite sequence would make len, contains, and reversed 
ill-defined (it also wouldn't allow certain kinds of slices)

> Do Sized and *Reversible* imply that a sequence terminates?
> Could __len__ return inf?

__len__ must return an integer.

> Perhaps `Ordered` is a requisite condition for defining a comparator 
> for Sequences.
> `OrderedSequence`?
> 
> Are there unordered Sequences for which a default `__eq__` / `__cmp__` 
> (et. al) would be wrong or inappropriate?

I don't think so [index as a mixin implies being ordered, i think]... the 
bigger problem is the one I mentioned earlier, that allowing comparison between 
sequences of different types is inconsistent with tuple and list.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/LMR7PSLJHSYQFMMWEAW337G3YBXC437U/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to