Eric V. Smith <e...@trueblade.com> added the comment:

Oops, slight bug in my code. Use this:

import re

def f(map):
    print(f'input={map["one"]} {map["two"]}')
    match map:
        case {'one': x, 'two': y}:
            print(f"match {x} {y}")
        case _:
            print("no match")

d = {'one':0, 'two':1}
f(d)
m = re.match("(?P<one>a)b(?P<two>c)", "abc")
f(m)

With this output:
input=0 1
match 0 1
input=a c
no match

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46692>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to