On Sun, Dec 8, 2019 at 11:03 AM Anders Hovmöller <bo...@killingar.net> wrote:
> > > > On 8 Dec 2019, at 19:40, Guido van Rossum <gu...@python.org> wrote: > > > > def first(it, /, default=None): > > it = iter(it) > > try: > > return next(it) > > except StopIteration: > > return default > > Why ban the use of keyword argument for the default value? You must misremember PEP 570. This use of `/` means that `it` must be passed positional (it's mandatory and it's the "main" argument), but that `default` can be specified positionally or via a keyword. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ 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/S37QIZFWOC6E2RBWZ2KDK7YDTF3775JW/ Code of Conduct: http://python.org/psf/codeofconduct/