[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Robert Spralja
Robert Spralja added the comment: I understand that it's invalid synatax, but not why. On Sat, 26 Feb 2022 at 10:07, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > > It is an invalid syntax. Write foo(*((stri,) if stri else ())). > > -- &g

[issue46865] *() Invalid Syntax: iterable unpacking of empty tuple

2022-02-26 Thread Robert Spralja
New submission from Robert Spralja : ` >>> def foo(num=1): ... return num ... >>> foo(*(bool,) is bool else *()) File "", line 1 foo(*(bool,) is bool else *()) ^ SyntaxError: invalid syntax >>> foo(*(bool,) if bool else