Question: how do I merge two objects? I would like to be able to have an instance of Foo and an instance of Boo and then be able to add them together and create a new object that has the methods and properties of both objects. I am going to be doing a lot of this and I don't want to have to dynamically (or otherwise) create a whole bunch of classes that inherit from both Foo and Boo then create instances of those new children classes. In fact, this wouldn't work for me anyway because I am going to have an instance of Foo which will be used within my algorithm for sometime then later I will want to merge it with a fresh instance of Boo or otherwise give it all the methods and properties of the Boo class. Am I making any sense here?

Thanks.

 - OP

P.S. I also noticed that we can no long use the __members__ property to get a tuple of all a class's methods. How can I get the same info from dir()? Dir(), I understand, tells you about all properties and you can't tell it to just list the methods.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to