This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author spralja
Recipients spralja
Date 2022-02-26.09:04:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645866272.11.0.779642676261.issue46865@roundup.psfhosted.org>
In-reply-to
Content
`
>>> def foo(num=1):
...     return num
...
>>> foo(*(bool,) is bool else *())
  File "<stdin>", line 1
    foo(*(bool,) is bool else *())
                         ^
SyntaxError: invalid syntax
>>> foo(*(bool,) if bool else *())
  File "<stdin>", line 1
    foo(*(bool,) if bool else *())
                              ^
SyntaxError: invalid syntax
>>> def foo(num=1):
...     return num
...
>>> stri = ''
>>> foo(*(stri,) if stri else *())
  File "<stdin>", line 1
    foo(*(stri,) if stri else *())
                              ^
SyntaxError: invalid syntax
>>> foo(*((stri,) if stri else ()))
1
>>>
`

Iterable unpacking of empty tuple seems to not work in one example but does in another.
History
Date User Action Args
2022-02-26 09:04:32spraljasetrecipients: + spralja
2022-02-26 09:04:32spraljasetmessageid: <1645866272.11.0.779642676261.issue46865@roundup.psfhosted.org>
2022-02-26 09:04:32spraljalinkissue46865 messages
2022-02-26 09:04:32spraljacreate