fork(2) download
  1. class Foo(float):
  2. def __new__(cls, value, extra):
  3. return float.__new__(cls, value)
  4. def __init__(self, value, extra):
  5. super().__init__()
  6. self.extra = extra
  7.  
  8. f = Foo(1.0, "unity")
  9.  
  10. print (f, f.extra)
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
1.0 unity