On 24/06/20 11:57 am, Guido van Rossum wrote:
Matched key-value pairs must already be present in the mapping, and not
created
on-the-fly by ``__missing__`` or ``__getitem__``. For example,
``collections.defaultdict`` instances will only match patterns with keys
that
were already present when the ``match`` block was entered.
Does that mean the pattern matching logic is in cahoots with
collections.defaultdict? What if you want to match against
your own defaultdict-like type?
--
Greg
_______________________________________________
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/SWU76B4K3QTDVYTCNC6NN6DX5SBNBS4Q/
Code of Conduct: http://python.org/psf/codeofconduct/