Message342583
This is not a new case. This is exactly the same problem which has already been fixed in multiple other projects.
Could you show your real code Anthony? In all known opensource examples (astroid, pyflakes, genshi, chameleon, mako) the compatibility fix is as simple as
def visit_Constant(self, node):
if node.value is Ellipsis:
self._write('...')
else:
self._write(repr(node.value))
In return, you can remove several methods, such as visit_Str, visit_Num, etc, once you drop the support of Python versions <3.8.
AST is not stable. Virtually in every version the new nodes are added: for asynchronous constructions, for f-strings, etc, and the structure and meaning of existing nodes can be changed. |
|
Date |
User |
Action |
Args |
2019-05-15 16:05:28 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, mbussonn, Anthony Sottile |
2019-05-15 16:05:28 | serhiy.storchaka | set | messageid: <1557936328.43.0.25591779802.issue36917@roundup.psfhosted.org> |
2019-05-15 16:05:28 | serhiy.storchaka | link | issue36917 messages |
2019-05-15 16:05:28 | serhiy.storchaka | create | |
|