> If Python were going to address this problem, I think it better to do
> something like:
>
> def teleport(from, to, hitchiker => Fly(), accessory =>
> Towel(hitchhiker)):
> etc.
>
> Where => specifies an expression thst is evaluated inside the function and Is
> approximately equivalent to your code except it works even if the caller
> passes None. (I don't know what the right syntax for this would be. I just
> picked => as something that is suggestive, not legal today and isn't ?= to
> avoid confusion with your proposal.)
I was gonna reply pretty much exactly this! I was gonna suggest this syntax:
def foo(a=new {}):
Which is a bit more explicit I think, but smells a bit C++.
/ Anders
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/