Given the following trivial function:
def func(x):
return x if True else x, x
Why is func(1)
returns the tuple (1, 1)
, even if the desired results would be the identity?
However, note that the following:
def func(x):
return x if True else (x, x)
Does return the desired integer type. Can anyone explain such behavior and why this happens?