-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rewriting tuple indices in python3.9 and python3.10
- Loading branch information
Showing
4 changed files
with
41 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from ast import * | ||
import typing | ||
|
||
from ..util import CompilingNodeTransformer | ||
|
||
""" | ||
Rewrites all Index/Slice occurrences such that they look like in Python 3.9 onwards (not like Python 3.8). | ||
""" | ||
|
||
|
||
class RewriteSubscript38(CompilingNodeTransformer): | ||
step = "Rewriting Subscripts" | ||
|
||
def visit_Index(self, node: Index) -> AST: | ||
return self.visit(node.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters