language-python icon indicating copy to clipboard operation
language-python copied to clipboard

Absent of python 3.8 feature "assignment expression"

Open JackAllTrades-MoN opened this issue 3 years ago • 1 comments

Summary

Assignment expression (https://www.python.org/dev/peps/pep-0572/) is not yet available on language-python.

  • result on ghci
*PyParser> import qualified Language.Python.Version3.Parser as PyParser
*PyParser> PyParser.parseExpr "print(x := 2)" ""
Left (UnexpectedToken (ColonToken {token_span = SpanPoint {span_filename = "", span_row = 1, span_column = 9}}))
  • example on python3.8
>>> print(x := 2)
2

Note

If you don't mind, I'll send a PR of this issue later. Please, check if it looks ok.

JackAllTrades-MoN avatar Aug 01 '21 05:08 JackAllTrades-MoN

Thanks @JackAllTrades-MoN.

PR would be appreciated. If possible, please include test cases as well.

Cheers!

bjpop avatar Aug 02 '21 00:08 bjpop