On 03.03.2017 16:24, Yury Selivanov wrote:
TBH I think that optional parameters isn't a problem requiring new
syntax. We probably do need syntax for positional-only arguments
(since we already have them in a way), but optional parameters
can be solved easily without a new syntax.
Syntax like:
1. def a(?foo),
2. def a(foo=pass),
3. def a([foo]),
will complicate the language too much IMO.
Yury
I never really encountered a real-world use where I would have needed
this kind of parameter declaration ability.
It's like the ++ operator of C which comes in pre- and postfix notation.
It's really cool to teach the nuances of it. And to create exam
questions using it. And to confuse students. But completely unnecessary
in real-life code.
Sven
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/