Commit 2cbc2f19 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Support passing keywords from inside a function

(was previously only working at the global scope)
parent e6cbc8ae
......@@ -159,7 +159,7 @@ public:
virtual bool visit_if(AST_If* node) { return false; }
virtual bool visit_ifexp(AST_IfExp* node) { return false; }
virtual bool visit_index(AST_Index* node) { return false; }
// virtual bool visit_keyword(AST_keyword *node) { return false; }
virtual bool visit_keyword(AST_keyword *node) { return false; }
virtual bool visit_list(AST_List* node) { return false; }
virtual bool visit_listcomp(AST_ListComp* node) { return false; }
// virtual bool visit_module(AST_Module *node) { return false; }
......
def f(a, b, c):
print a, b, c
def f():
def f1(a, b, c):
print a, b, c
f(1, 2, 3)
f(1, b=2, c=3)
f(1, b=2, c=3)
f(1, c=2, b=3)
f1(1, 2, 3)
f1(1, b=2, c=3)
f1(1, b=2, c=3)
f1(1, c=2, b=3)
f(1, b="2", c=3)
f(1, b=2, c="3")
f(1, c="2", b=3)
f(1, c=2, b="3")
f1(1, b="2", c=3)
f1(1, b=2, c="3")
f1(1, c="2", b=3)
f1(1, c=2, b="3")
def f(*args, **kw):
print args, kw
def f2(*args, **kw):
print args, kw
f()
f(1)
f(1, 2)
f((1, 2))
f(*(1, 2))
f({1:2}, b=2)
f2()
f2(1)
f2(1, 2)
f2((1, 2))
f2(*(1, 2))
f2({1:2}, b=2)
def f(a=1, b=2, **kw):
print a, b, kw
def f3(a=1, b=2, **kw):
print a, b, kw
f(b=3, c=4)
f(b=3, a=4)
f(b=2, **{'c':3})
f3(b=3, c=4)
f3(b=3, a=4)
f3(b=2, **{'c':3})
f()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment