On Sat, May 23, 2020 at 2:37 AM Steven D'Aprano <st...@pearwood.info> wrote:

> On Thu, May 21, 2020 at 02:50:00PM +0200, Alex Hall wrote:
>
> or a more realistic example:
> >
> >     def func(options=:{}):
>
>
> Add annotations and walrus operator:
>
>     def flummox(options:dict=:(a:={x: None})):
>
> and we now have *five* distinct meanings for a colon in one line.
>

OK, let's forget the colon. The point is just to have some kind of
'modifier' on the default value to say 'this is evaluated on each function
call', while still having something that looks like `arg=<default>`. Maybe
something like:

     def func(options=from {}):
_______________________________________________
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/TG27FHZLY4VHE7QNHM5VAVCYZKZVFHCI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to