>> Does that mean that first() and next() are undefined for sets?

[Stephen J. Turnbull <turnbull.stephen...@u.tsukuba.ac.jp>]
> first() is undefined.  next() is defined by reference to iterating
> over the set (that's why I don't have a problem with iterating over a
> set).

Every suggestion here so far has satisfied that, if S is a non-empty set,

    assert next(iter(S)) is first(S)

succeeds.  That is, `first()` is _defined_ by reference to iteration
order.  It's "the first" in that order (hence the name).
_______________________________________________
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/VEGJZW6KSL75P6YK522KIYHNNKPXDE5N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to