Hi,

I wish I'd read this before replaying your last email

On 18/02/2021 6:49 pm, Brandt Bucher wrote:
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?

Not quite. It uses the instance dictionary to avoid capturing bound methods and other computed attributes.

I'll make this more prominent.

Cheers,
Mark.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/QNASJRQ63QV5DML3LL4WIV34NKRHLWGL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to