In Python super () or object .__ new__ newspaper TypeError: object .__ new __ () takes no arguments wrong solution

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

This happens to call a method parameter object class __new__ more lead:
general is the use of similar Super () new new (CLS, args *, ** kwargs)
. Or object new new (Self, args *, ** kwargs)
this way call, this time as long as the change:
. Super () new new . (CLS) or Object new new (Self)
calls it.
Note: If the parent is not a direct object, by calling super __new__ served the method parameters need to see how I discovered the direct parent of the passed parameters, old ape recommended __new__ object method call.
Related issues please refer to: __new__ Python class method in-depth analysis: call the parent class method parameters __new__ confusion

Guess you like

Origin blog.csdn.net/LaoYuanPython/article/details/93643703