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

Method test_proxy_index

Lib/test/test_weakref.py:339–345  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

337 self.assertEqual(bytes(weakref.proxy(instance)), b"bytes")
338
339 def test_proxy_index(self):
340 class C:
341 def __index__(self):
342 return 10
343 o = C()
344 p = weakref.proxy(o)
345 self.assertEqual(operator.index(p), 10)
346
347 def test_proxy_div(self):
348 class C:

Callers

nothing calls this directly

Calls 4

proxyMethod · 0.80
CClass · 0.70
assertEqualMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected