MCPcopy Index your code
hub / github.com/RustPython/RustPython / __eq__

Method __eq__

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

Source from the content-addressed store, hash-verified

3231 self.assertEqual(1+0j, z)
3232 class ZZ(complex):
3233 def __eq__(self, other):
3234 try:
3235 return abs(self - other) <= 1e-6
3236 except:
3237 return NotImplemented
3238 zz = ZZ(1.0000003)
3239 self.assertEqual(zz, 1+0j)
3240 self.assertEqual(1+0j, zz)

Callers

nothing calls this directly

Calls 1

absFunction · 0.50

Tested by

no test coverage detected