class Foo(float):

    def __new__(self, value, extra):
        return float.__new__(self, value)

def __init__(self, value, extra):
    float.__init__(value)
self.extra = extra
foo = Foo(1, 2)
print(str(foo))
1.0
print(str(foo.extra))
2
Python: Can a subclass of float take extra arguments in its constructor?