functemplate: Adapt ast syntax to PEP570 changes on python3.8#3278
functemplate: Adapt ast syntax to PEP570 changes on python3.8#3278sampsyo merged 2 commits intobeetbox:masterfrom
Conversation
|
Thanks for pointing this out! It is sort of frustrating that these AST incompatibilities keep cropping up, but I think that's unavoidable. For a small improvement in legibility/maintainability, what do you think about using a "feature test" instead of a version check to see whether the appropriate field needs to be included? The >>> 'kwonlyargs' in ast.arguments._fields
True
>>> 'posonlyargs' in ast.arguments._fields
FalseI think a short changelog entry might be a good idea, even if we need to mention that "real" Python 3.8 compatibility will need to wait for Werkzeug. Especially because Werkzeug is not a "core" dependency (it's only necessary for the web plugin). |
|
Gave that a try above. |
functemplate: Adapt ast syntax to PEP570 changes on python3.8
|
Thanks for finishing this up for the release 🎉 Sorry for not replying, I was away from keyboard for a few days... |
|
No worries at all! Thanks again for your help. |
Python 3.8 adds the required
posonlyargstoast.arguments(see the Grammar), resulting in failures such as these: https://travis-ci.org/geigerzaehler/beets-alternatives/jobs/538912903.There's some discussion about similar breaking API changes (namely in the inspect module) here and here, which however does not mention the lower level ast syntax changes, so I'm assuming that the ast module is supposed to always reflect the grammer such that this is not to be considered a regression.
Does this warrant a changelog entry? Due to the werkzeug incompatibility, Python 3.8 still is not fully supported.