We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55169bb commit d60d56aCopy full SHA for d60d56a
3 files changed
CHANGELOG.md
@@ -4,6 +4,7 @@
4
- #786 Upgrade Actions used in Github Workflows (@lieryan)
5
- #785 Refactoring movetest.py (@lieryan)
6
- #788 Introduce the `preferred_import_style` configuration (@nicoolas25, @lieryan)
7
+- #819 supports MatchOr, MatchSequence, MatchStar (@jheld)
8
9
# Release 1.13.0
10
rope/refactor/patchedast.py
@@ -785,6 +785,13 @@ def _Match(self, node):
785
children.extend(node.cases)
786
self._handle(node, children)
787
788
+ def _MatchOr(self, node):
789
+ children = [*self._child_nodes(node.patterns, "|")]
790
+ self._handle(node, children)
791
+
792
+ def _MatchSingleton(self, node):
793
+ self._handle(node, [str(node.value)])
794
795
def _match_case(self, node):
796
children = ["case", node.pattern]
797
if node.guard:
@@ -793,6 +800,13 @@ def _match_case(self, node):
800
children.extend(node.body)
801
802
803
+ def _MatchSequence(self, node):
804
+ children = ["[", *self._child_nodes(node.patterns, ","), "]"]
805
806
807
+ def _MatchStar(self, node):
808
+ self._handle(node, ["*_"])
809
810
def _MatchAs(self, node):
811
if node.pattern:
798
812
children = [node.pattern, "as", node.name]
0 commit comments