> On 8 Dec 2019, at 20:11, Guido van Rossum <[email protected]> wrote: > > >> On Sun, Dec 8, 2019 at 11:03 AM Anders Hovmöller <[email protected]> wrote: >> >> >> > On 8 Dec 2019, at 19:40, Guido van Rossum <[email protected]> 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. >
Ah. Sorry. My bad.
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/BGUVKZ7VCZQ3PNXPXEQ7IWXGJOWWYUSS/ Code of Conduct: http://python.org/psf/codeofconduct/
