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:
parent
bedff70793
commit
afba5b755a
3 changed files with 37 additions and 24 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue