MCPcopy Index your code
hub / github.com/python/cpython / test_non_generic_subscript

Method test_non_generic_subscript

Lib/test/test_collections.py:709–719  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

707 self.assertEqual(Point.__match_args__, ('x', 'y'))
708
709 def test_non_generic_subscript(self):
710 # For backward compatibility, subscription works
711 # on arbitrary named tuple types.
712 Group = collections.namedtuple('Group', 'key group')
713 A = Group[int, list[int]]
714 self.assertEqual(A.__origin__, Group)
715 self.assertEqual(A.__parameters__, ())
716 self.assertEqual(A.__args__, (int, list[int]))
717 a = A(1, [2])
718 self.assertIs(type(a), Group)
719 self.assertEqual(a, (1, [2]))
720
721
722################################################################################

Callers

nothing calls this directly

Calls 3

AClass · 0.70
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected