Only apply non-default params logic prior to the star (fixes #161)

This commit is contained in:
Bryan Forbes
2021-02-15 19:20:43 -06:00
parent 93206f6eba
commit e5731d3932
3 changed files with 40 additions and 6 deletions

View File

@@ -46,6 +46,28 @@ def x(b=a):
global a
def x(*args, c=2, d):
pass
def x(*, c=2, d):
pass
def x(a, b=1, *args, c=2, d):
pass
def x(a, b=1, *, c=2, d):
pass
lambda *args, c=2, d: (c, d)
lambda *, c=2, d: (c, d)
lambda a, b=1, *args, c=2, d: (c, d)
lambda a, b=1, *, c=2, d: (c, d)
*foo, a = (1,)
*foo[0], a = (1,)
*[], a = (1,)