18 Feb
2021
18 Feb
'21
10:49 a.m.
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?