Categories

Support Wikipedia

Python3 doesn’t support tuple as a parameter in a function

If you are trying to convert some Python2 code to Python3 and running into syntax error like this:

% python3 t1.py
File “t1.py”, line 2
def f1 (a, (b,c)):
………………^
SyntaxError: invalid syntax

that is because Python3 does not support tuple as a parameter in a function.

You can see the reason and how to work around this error here:

PEP 3113 — Removal of Tuple Parameter Unpacking

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>