I have a piece of code that looks completely fine,
def _change_id(self, model, path, it,(old_id, new_id)):
But whenever I try to run it in my terminal python returns, "SyntaxError: invalid syntax"
I have a piece of code that looks completely fine,
def _change_id(self, model, path, it,(old_id, new_id)):
But whenever I try to run it in my terminal python returns, "SyntaxError: invalid syntax"
The use of the tuple parameter was removed in python 3.0. This caused more issues than it was worth. You can rewrite it this way:
def fun(p1, b_c, p2):
b, c = b_c
the parameter b_c
was a tuple:
fun(1, (1, 2), 3)
Apparently, tupple parameter unpacking was removed in python 3 as per this link here
Edit: @Yoav and @jonrsharpe beat me to it