Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5edd993

Browse files
Regression test for match variable inside match (psf#3993)
1 parent 9a90fa2 commit 5edd993

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/data/cases/pattern_matching_complex.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,9 @@
147147
match (X.type, Y):
148148
case _:
149149
pass
150+
# issue 3487
151+
match = re.match(r"(?P<grade>LD|MD|HD)(?P<material>AL|SS)", "HDSS")
152+
153+
match (match.group("grade"), match.group("material")):
154+
case ("MD" | "HD", "SS" as code):
155+
print("You will get here")

0 commit comments

Comments
 (0)