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

Looking at PEP 634, the obvious way to add support for this is to have the 
re.Match object specify Py_TPFLAGS_MAPPING. But I tried that, and then I get 
this error when using an re.Match object in a match statement:

    case {'one': x, 'two': y}:
         ^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 're.Match' has no len()


Add len() to re.Match objects was rejected when __getitem__ was added to 
re.Match, in issue 24454.

I haven't explored other ways to support re.Match objects in the match 
statement.

----------

_______________________________________
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