Reputation: 50458
Is the following correct Python code? If not, what's the correct syntax for this kind of expression?
x = lambda (y, z=None) : y if z == None else z
Upvotes: 2
Views: 104
Reputation: 62938
You don't need the parentheses:
x = lambda y, z=None: y if z is None else z
Upvotes: 3