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

Class Proxy

Lib/test/test_descr.py:2345–2369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2343 self.assertNotIn(10, d1)
2344 # Test overridden behavior
2345 class Proxy(object):
2346 def __init__(self, x):
2347 self.x = x
2348 def __bool__(self):
2349 return not not self.x
2350 def __hash__(self):
2351 return hash(self.x)
2352 def __eq__(self, other):
2353 return self.x == other
2354 def __ne__(self, other):
2355 return self.x != other
2356 def __ge__(self, other):
2357 return self.x >= other
2358 def __gt__(self, other):
2359 return self.x > other
2360 def __le__(self, other):
2361 return self.x <= other
2362 def __lt__(self, other):
2363 return self.x < other
2364 def __str__(self):
2365 return "Proxy:%s" % self.x
2366 def __repr__(self):
2367 return "Proxy(%r)" % self.x
2368 def __contains__(self, value):
2369 return value in self.x
2370 p0 = Proxy(0)
2371 p1 = Proxy(1)
2372 p_1 = Proxy(-1)

Callers 3

test_specialsMethod · 0.70
test_isinst_isclassMethod · 0.70
test_proxy_superMethod · 0.70

Calls

no outgoing calls

Tested by 3

test_specialsMethod · 0.56
test_isinst_isclassMethod · 0.56
test_proxy_superMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…