Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.8 support for macro code #16

Closed
Technologicat opened this issue Aug 8, 2019 · 8 comments
Closed

Python 3.8 support for macro code #16

Technologicat opened this issue Aug 8, 2019 · 8 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@Technologicat
Copy link
Owner

In the Python 3.8 AST, all constants are now represented by the ast.Constant node type.

Thus to support 3.8 and later properly, we will need to update any macro code that deals with Num, Str, NameConstant.

Maybe in 0.15, move these into syntax.astcompat, and start accepting Constant nodes as an alternative.

There are not many use sites, so it's probably not worth building an abstraction for this.

@Technologicat Technologicat added the enhancement New feature or request label Aug 8, 2019
@Technologicat Technologicat added this to the 0.15 milestone Aug 8, 2019
@Technologicat
Copy link
Owner Author

Related to #1.

@Technologicat
Copy link
Owner Author

Issues cleanup: 0.15 is probably a long way off; we should actually add 3.8 support earlier. Maybe in a small service release after 0.14.2?

@Technologicat Technologicat modified the milestones: 0.15, 0.14.x Feb 27, 2020
@Technologicat
Copy link
Owner Author

The GTS docs have updated to 3.8.

@Technologicat Technologicat modified the milestones: 0.14.x, 0.14.3 Aug 7, 2020
@Technologicat Technologicat self-assigned this Aug 8, 2020
@Technologicat Technologicat added the bug Something isn't working label Aug 11, 2020
@Technologicat
Copy link
Owner Author

This is a bug in that until we support ast.Constant, the macros won't work right on Python 3.8.

@Technologicat
Copy link
Owner Author

0.14.3 is becoming such a big update already, maybe it's better to add Python 3.8 support in the next release.

@Technologicat Technologicat modified the milestones: 0.14.3, 0.14.4 Aug 29, 2020
@Technologicat Technologicat modified the milestones: 0.14.5, 0.14.4 Sep 11, 2020
@Technologicat Technologicat changed the title AST representation of constants changed in Python 3.8 Python 3.8 support for macro code Sep 11, 2020
@Technologicat
Copy link
Owner Author

Also consider if we need to do something with ast.NamedExpr introduced in 3.8.

@Technologicat
Copy link
Owner Author

While at it, we should add support also for Python 3.9.

The ast.Index wrapper in ast.Subscript is gone, and ast.ExtSlice has changed a bit. See Technologicat/mcpyrate#20.

@Technologicat
Copy link
Owner Author

Done. Now just need to port the macro code to mcpyrate (which is orthogonal to the AST changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant