foo((a)=1)!?
https://github.com/python/cpython/issues/78822
Python 3.8で修正されている
関数内でのキーワード名に関する構文の制限が強化されました。具体的には、f((keyword)=arg) の表現が許容されなくなりました。キーワード引数への代入の際、左側にキーワードそのまま以外の表現を許可する意図は、以前からありませんでした。 (Benjamin Peterson の貢献による bpo-34641)
ref: https://docs.python.org/ja/3/whatsnew/3.8.html#other-language-changes
code:Python 3.7.9.py
>> def foo(a):
... return a
...
>> foo(a=1)
1
>> foo((a)=1)
1
code:Python 3.8.6.py
>> def foo(a):
... return a
...
>> foo(a=1)
1
>> foo((a)=1)
File "<stdin>", line 1
SyntaxError: expression cannot contain assignment, perhaps you meant "=="?