In RustPython, __new__ is bound method but it should be a static method.
class A:
def __new__(*args, **kwargs):
print("Args Total: {}".format(len(args)+len(kwargs)))
class B(A):
def __new__(cls, *args, **kwargs):
return super().__new__(cls, *args, **kwargs)
"""
>>> B()
CPython output
Args Total: 1
RustPython output
Args Total: 2
"""
super().new(cls, *args, **kwargs) will pass two same ype class(args[0] is same as cls).
object __new__ Python docuemtion
In RustPython, __new__ is bound method but it should be a static method.
super().new(cls, *args, **kwargs) will pass two same ype class(args[0] is same as cls).
object __new__ Python docuemtion