new-style-classes mixin

J.Jacob joost_jacob at
Fri Aug 9 04:46:26 EDT 2002

Greg Chapman <glc at> wrote:
> Looking at your, it seems to me it would
> be more straightforward to have MyServer simply inherit from swc.Server.
> Perhaps the real point is to allow any arbitrary object (from any arbitrary
> module) to act as a server?

Yes that's it.  We would like to be able to turn any object O into a
server (even if you do not have the source code, or it comes from an
extension in C, so you can not use 'normal' inheritance by changing
the object's Python class definition.  We do not want to change the
class X for all instances of X, but only the object O's class X.

> It seems like SimpleXMLRPCServer.register_instance
> is designed to support this (possibly with an intermediate object to handle
> the dispatching).  Is there some drawback to using that method?

That is what I am looking into now.  We want to define a 'port'
mentioning the operations that will be available.  Not all the
object's methods should be accessible via XML-RPC.  A list of strings
(method names) could be used, or an 'interface' sort of class.

Best regards


More information about the Python-list mailing list