Closed FelixSchwarz closed 4 years ago
Python 3.9 has been released. Would you mind merging #24 and this PR?
LGTM
Python 3.9 has been released. Would you mind merging #24 and this PR?
@FelixSchwarz Thank you! I've merged #24. Would you mind merging master into this PR and then I can review it?
sure, will try to do this later this evening
I rebased the commits on top of the current master so I hope they are easier to review now :-)
Hi folks, I just wanted to ask if you're considering tagging a 0.7.3 release once this (and any other needed PRs) are merged and Python 3.9 is fully supported?
Yeah, a new release would be helpful also for me (so Fedora can stop shipping these patches on top of the last release). But we need to fix the AST changes first.
Hi folks, I just wanted to ask if you're considering tagging a 0.7.3 release once this (and any other needed PRs) are merged and Python 3.9 is fully supported?
Definitely. Making a new release is not hard these days, so it should be able to happen as soon as this PR lands.
I think I didn't mention the relevant pieces from the Python 3.9 Release Notes regarding the AST changes:
Simplified AST for subscription. Simple indices will be represented by their value, extended slices will be represented as tuples.
Index(value)
will return avalue
itself,ExtSlice(slices)
will returnTuple(slices, Load())
. (Contributed by Serhiy Storchaka in bpo-34822.)ast classes
slice
,Index
andExtSlice
are considered deprecated and will be removed in future Python versions.value
itself should be used instead ofIndex(value)
.Tuple(slices, Load())
should be used instead ofExtSlice(slices)
. (Contributed by Serhiy Storchaka in bpo-34822.)
I plan on extending the commit message once we have a nice changeset as I think this might provide some valuable context for the commit contents. Again - feel free to improve the code as I don't have any experience working with the AST (and the little bit I gained vanished in the months since I first created this PR).
I added a few commits but it still feels a bit "clumsy" (maybe a more able person might understand the actual meaning of Python's AST changes better). Feedback welcome.
This is my attempt to provide Python 3.9 compatibility (see #23). The test suite passes and I added a few extra tests which were only present in doctest. This pull request is based on top of PR #24.
The main AST changes are in commit 7f4e56e .
Please note that I'm totally out of my depth here. I never interacted so closely with Python's AST and this is mostly based on trial and error.