New submission from Eric V. Smith <[email protected]>:
You need to provide more information.
Is your concern that re.match objects aren't matched like dicts are, despite
looking like a mapping?
import re
def f(map):
print(f'input={m["one"]} {m["two"]}')
match map:
case {'one': x, 'two': y}:
print(f"match {x} {y}")
case _:
print("no match")
m = re.match("(?P<one>a)b(?P<two>c)", "abc")
d = {'one':0, 'two':1}
f(d)
f(m)
produces:
input=a c
match 0 1
input=a c
no match
I assume you're not reporting a bug, so I'm going to mark this as a feature
request.
----------
nosy: +eric.smith
type: behavior -> enhancement
versions: -Python 3.10
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46692>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com