On 2010-11-24 12:08:04 -0800, Raymond Hettinger said:

I'm writing-up more guidance on how to use super() and would like to point at some real-world Python examples of cooperative multiple inheritance.

The SocketServer module (http://docs.python.org/library/socketserver.html) uses cooperative multiple inheritance to implement threading / async using a ThreadingMixIn class and multi-processing using a ForkingMixIn class, which may not be as complicated a use case as you are looking for.

One thing that caught me up was the attribute resolution order; it's a FIFO, with the first superclass being examined preferentially over later superclasses in the declaration. (Mixins go before the class they extend.)

— Alice.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to