class Foo(int): def __new__(cls, v): return int.__new__(cls, v) i = 3783907807 print(i.bit_length()) f = Foo(3783907807) print(f)