On Thu, May 28, 2020 at 5:05 PM Greg Ewing <[email protected]> wrote: > > On 28/05/20 12:38 pm, Rob Cliffe wrote: > > why not go > > further (as the OP suggested as far as I recall) > > and allow the more concise > > > > def order(eggs = 4, spam ?= Spam()): > > etc. > > That clutters up the header with things that are not part of > the function's signature. All the caller needs to know is that > the spam argument is optional. The fact that a new Spam object > is created on each call if he doesn't supply one is an > implementation detail. >
Is it an implementation detail that 4 will be used for eggs if it isn't passed? I think this is part of the function's API, not its implementation. ChrisA _______________________________________________ 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/PPACG3BQVLI7XTO64ZDSIBHDOMTWUNHZ/ Code of Conduct: http://python.org/psf/codeofconduct/
