On 20.04.2020 13:00, Steven D'Aprano wrote:
On Mon, Apr 20, 2020 at 10:03:50AM +0200, M.-A. Lemburg wrote:
Guys, is it really worth saving a few hits on the auto-complete key by adding even more mysterious twists to the existing Python function call syntax ?
The current version already strikes me as way too complex. It's by far the most complex piece of grammar we have in Python:
(I think you pasted the typedarglist rules twice.)
No, there are two lists: typedargslist and varargslist. The latter is only used in lambda functions, which don't support type annotations (yet another twist to remember when it comes to function calls).
Now that Python is moving to a PEG parser, could it be simplified?
Perhaps, but that's not really the point I wanted to make.
If it's difficult to spell the correct syntax in a parser grammar, then humans will have trouble understanding it as well, esp. people new to Python.