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

Class hexint

Lib/test/test_descr.py:2865–2871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2863 # Testing inheritance from basic types...
2864
2865 class hexint(int):
2866 def __repr__(self):
2867 return hex(self)
2868 def __add__(self, other):
2869 return hexint(int.__add__(self, other))
2870 # (Note that overriding __radd__ doesn't work,
2871 # because the int type gets first dibs.)
2872 self.assertEqual(repr(hexint(7) + 9), "0x10")
2873 self.assertEqual(repr(hexint(1000) + 7), "0x3ef")
2874 a = hexint(12345)

Callers 2

__add__Method · 0.85

Calls

no outgoing calls

Tested by 2

__add__Method · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…