raincoat icon indicating copy to clipboard operation
raincoat copied to clipboard

With Python 3.8, we can remove a lot of ast code

Open ewjoachim opened this issue 6 years ago • 0 comments

From Python 3.8 release notes:

ast AST nodes now have end_lineno and end_col_offset attributes, which give the precise location of the end of the node. (This only applies to nodes that have lineno and col_offset attributes.) New function ast.get_source_segment() returns the source code for a specific AST node.

https://docs.python.org/3/whatsnew/3.8.html#ast

CodeLocator (https://github.com/peopledoc/raincoat/blob/master/raincoat/parse.py#L9) can be simplified for 3.8.

ewjoachim avatar Oct 21 '19 00:10 ewjoachim