Fix Python default args when using kwargs

Recent default arg handling fixes didn't fix the case when kwargs is turned on
This commit is contained in:
William S Fulton 2015-01-15 07:54:36 +00:00
commit afba5b755a
3 changed files with 37 additions and 24 deletions

View file

@ -51,7 +51,7 @@ if foo_fn(b=2) != 3:
raise RuntimeError
#Funtions with keywords
#Functions with keywords
if foo_kw(_from=2) != 4:
raise RuntimeError
@ -65,3 +65,17 @@ if foo_mm(min=2) != 4:
if foo_mm(max=3) != 4:
raise RuntimeError
#Default args with references
if rfoo(n=123) != 120:
raise RuntimeError
if rfoo(x=10) != -10:
raise RuntimeError
if rfoo(n=11, x=22) != -11:
raise RuntimeError
if rfoo(x=11, n=22) != 11:
raise RuntimeError