[issue46692] match case does not support regex

Eric V. Smith report at bugs.python.org
Wed Feb 9 12:12:50 EST 2022


Eric V. Smith <eric at trueblade.com> added the comment:

Good catch, @xtreak. I think something like the discussed (but not implemented) custom matching protocol would be required here. __match_args__ won't work, because it's a special attribute only checked on classes, not instances.

Of course, I'm still not sure this is what the original poster is requesting!

But assuming so, this would require a PEP, and should be discussed with the PEP 634 authors.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46692>
_______________________________________


More information about the Python-bugs-list mailing list