
On Wed, Dec 11, 2019 at 5:14 PM Steven D'Aprano <steve@pearwood.info> wrote:
On Tue, Dec 10, 2019 at 07:21:13PM -0600, Tim Peters wrote:
While the meaning of `first()` is clear for any iterable argument.
Sorry Tim, I have to disagree. The meaning of `first` is:
return the first element of a sequence or container (in standard iteration order), OR the *next* element of an iterator
and I don't think that this is even a little bit clear from the name.
You know that cliche about how today is the first day of the rest of your life? Your life is an iterator. "Next" and "first" are basically synonymous when you can't go backwards. IMO the distinction you describe here isn't actually significant at all - either way, you get the first element of "whatever remains", and the only difference is whether it's nondestructive (with most containers) or destructive (iterators). ChrisA