summaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-03-28 23:49:17 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2000-03-28 23:49:17 +0000
commit7690151c7e95f38b91a9c572ce29b4d8a4ca671d (patch)
treefb8eb51104f6aaa895c37c4c144072be016674f5 /Grammar
parent93a7c0fe6b2186448ebe35a5af0ac3880d8f16fc (diff)
downloadcpython-git-7690151c7e95f38b91a9c572ce29b4d8a4ca671d.tar.gz
slightly modified version of Greg Ewing's extended call syntax patch
executive summary: Instead of typing 'apply(f, args, kwargs)' you can type 'f(*arg, **kwargs)'. Some file-by-file details follow. Grammar/Grammar: simplify varargslist, replacing '*' '*' with '**' add * & ** options to arglist Include/opcode.h & Lib/dis.py: define three new opcodes CALL_FUNCTION_VAR CALL_FUNCTION_KW CALL_FUNCTION_VAR_KW Python/ceval.c: extend TypeError "keyword parameter redefined" message to include the name of the offending keyword reindent CALL_FUNCTION using four spaces add handling of sequences and dictionaries using extend calls fix function import_from to use PyErr_Format
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar4
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index dabf88e5aa..57a39de2f0 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -23,7 +23,7 @@ eval_input: testlist NEWLINE* ENDMARKER
funcdef: 'def' NAME parameters ':' suite
parameters: '(' [varargslist] ')'
-varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' ('**'|'*' '*') NAME] | ('**'|'*' '*') NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [',']
+varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME] | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [',']
fpdef: NAME | '(' fplist ')'
fplist: fpdef (',' fpdef)* [',']
@@ -86,5 +86,5 @@ dictmaker: test ':' test (',' test ':' test)* [',']
classdef: 'class' NAME ['(' testlist ')'] ':' suite
-arglist: argument (',' argument)* [',']
+arglist: (argument ',')* (argument [',']| '*' test [',' '**' test] | '**' test)
argument: [test '='] test # Really [keyword '='] test