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

Method test_unbound_methods

Lib/test/test_genericalias.py:193–200  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

191 self.assertEqual(alias(iter((1, 2, 3))), t((1, 2, 3)))
192
193 def test_unbound_methods(self):
194 t = list[int]
195 a = t()
196 t.append(a, 'foo')
197 self.assertEqual(a, ['foo'])
198 x = t.__getitem__(a, 0)
199 self.assertEqual(x, 'foo')
200 self.assertEqual(t.__len__(a), 1)
201
202 def test_subclassing(self):
203 class C(list[int]):

Callers

nothing calls this directly

Calls 5

tFunction · 0.85
appendMethod · 0.45
assertEqualMethod · 0.45
__getitem__Method · 0.45
__len__Method · 0.45

Tested by

no test coverage detected