Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.
The test is some way below the other similar tests but anything
else would need a large renumbering.
* :class:`bytes`
* :class:`dict`
* :class:`float`
+ * :class:`frozendict`
* :class:`frozenset`
* :class:`int`
* :class:`list`
self.assertEqual(x, 0)
self.assertEqual(y, 1)
+ def test_patma_frozendict_class_self(self):
+ x = frozendict()
+ match x:
+ case frozendict(z):
+ y = 0
+ self.assertEqual(x, frozendict())
+ self.assertEqual(y, 0)
+ self.assertIs(z, x)
+
def test_patma_runtime_checkable_protocol(self):
# Runtime-checkable protocol
from typing import Protocol, runtime_checkable