Given is the following example:
class Foo(object): def __init__(self, value=0): self.value=value def __int__(self): return self.valu
In Python 2.4+ inheriting from int works:
class MyInt(int):pass f=MyInt(3) assert f + 5 == 8