[Tutor] Why are expressions not allowed as parameters in function definition statements?

eryk sun eryksun at gmail.com
Sun Jun 19 01:35:46 EDT 2016


On Sun, Jun 19, 2016 at 4:04 AM, Danny Yoo <dyoo at hashcollision.org> wrote:
>
>> def f((x,y), z):
> ...      print x, y, z
> ...
>>   f([1, 2], 3)
> 1 2 3

Note that Python 3 doesn't support tuple parameter unpacking. See PEP 3113:

https://www.python.org/dev/peps/pep-3113


More information about the Tutor mailing list