Skip to content

Python 3.8 support for macro code #16

Closed

Description

@Technologicat

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.

Activity

  1. added
    enhancement
    on Aug 8, 2019
  2. added this to the 0.15 milestone on Aug 8, 2019
  3. Technologicat commented on Aug 8, 2019

    @Technologicat
    OwnerAuthor

    Related to #1.

  4. Technologicat commented on Feb 27, 2020

    @Technologicat
    OwnerAuthor

    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?

  5. modified the milestones: 0.15, 0.14.x on Feb 27, 2020
  6. Technologicat commented on Mar 1, 2020

    @Technologicat
    OwnerAuthor

    The GTS docs have updated to 3.8.

  7. modified the milestones: 0.14.x, 0.14.3 on Aug 7, 2020
  8. self-assigned this
    on Aug 8, 2020
  9. added
    bug
    on Aug 11, 2020
  10. Technologicat commented on Aug 11, 2020

    @Technologicat
    OwnerAuthor

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

  11. Technologicat commented on Aug 29, 2020

    @Technologicat
    OwnerAuthor

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

  12. modified the milestones: 0.14.3, 0.14.4 on Aug 29, 2020
  13. modified the milestones: 0.14.5, 0.14.4 on Sep 11, 2020
  14. changed the title [-]AST representation of constants changed in Python 3.8[/-] [+]Python 3.8 support for macro code[/+] on Sep 11, 2020
  15. Technologicat commented on Sep 11, 2020

    @Technologicat
    OwnerAuthor

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

  16. modified the milestones: 0.14.4, 0.15 on Apr 12, 2021
  17. Technologicat commented on Apr 12, 2021

    @Technologicat
    OwnerAuthor

    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.

  18. Technologicat commented on Apr 21, 2021

    @Technologicat
    OwnerAuthor

    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

Metadata

Metadata

Assignees

Labels

bugenhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions