Its still different!Its still different! >>> c=C('1.0') >>> c.arg_a u'd' >>> c.arg_b u'0'
Cooperative InheritanceCooperative Inheritance Dont omit super(C, self).__init__() even if your base class is object Dont assume you know what arguments youre going to get Dont assume you know what arguments you should pass to super always pass all arguments you received on to super if classes can take differing arguments, always accept **kwargs
If you mix Class.__init__ and super() Youre gonna have a bad time
Mixins Not meant for instantiation on their own Enhance classes with independent functionality Not a form of specialisation but collection of functionality Like interfaces with built-in implementation Very reusable if orthogonal to the main type
Your consent to our cookies if you continue to use this website.