You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement assignment expressions (a.k.a. named expressions a.k.a. walrus operator) #6797
Python 3.8 (currently in beta) supports a new expression operator, :=, dubbed the "walrus operator" (PEP 572). Mypy should support this. Parsing is not a problem -- when we use Python 3.8 to run mypy, we use the stdlib ast module which knows how to parse it. But mypy always treats this as a blocking error, saying "assignment expressions are not yet supported".
This is already covered in #7316. Closing this issue as there is general support for assignment expressions; I opened a series of more specific issues for smaller remaining problems.
Activity
msullivan commentedon Jul 31, 2019
There was somebody who expressed interest in implementing this but I'm not sure if anything came of it. Was it @JelleZijlstra?
JelleZijlstra commentedon Aug 1, 2019
#6899 came out of it :) It's still waiting for review
Bidek56 commentedon Nov 21, 2019
PR #6899 was merged but I am not sure if work correctly.
mypy with Python 3.8 with the example code:
results in: error: Item "None" of "Optional[Match[str]]" has no attribute "group"
Any ideas would be appreciated. Thanks
JelleZijlstra commentedon Nov 22, 2019
This is already covered in #7316. Closing this issue as there is general support for assignment expressions; I opened a series of more specific issues for smaller remaining problems.