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

Method __eq__

Lib/test/test_descr.py:3325–3329  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

3323 self.assertEqual(1+0j, z)
3324 class ZZ(complex):
3325 def __eq__(self, other):
3326 try:
3327 return abs(self - other) <= 1e-6
3328 except:
3329 return NotImplemented
3330 zz = ZZ(1.0000003)
3331 self.assertEqual(zz, 1+0j)
3332 self.assertEqual(1+0j, zz)

Callers

nothing calls this directly

Calls 1

absFunction · 0.85

Tested by

no test coverage detected