[Python-Dev] Re: PEP 653: Precise Semantics for Pattern Matching

2021年2月18日 10:52:26 -0800

Brandt Bucher wrote:
> For a pattern with no positional subpatterns, such as like `C()` or `C(x=x, 
> y=y, z=z)`: ...
> It also appears that we lose a lot of expressive "idioms" by requiring 
> `__attributes__` to be complete.
> This also means that matching classes like `types.SimpleNamespace` are much 
> less powerful under PEP 653, since the class must know which attributes are 
> "allowed" to be looked up.
Never mind these three points... I *think* setting `__match_kind__ = 
MATCH_DEFAULT` allows for arbitrary attribute extraction like this. Perhaps 
make it bit clearer?
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/HCXNNE3B2SS3PFTDVMAA4EWNVXD6TH7W/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to