[Twisted-Python] Transporting pb.Copyable classes?

Andrew Bennetts andrew-twisted at puzzling.org
Tue Apr 20 20:12:28 EDT 2004


On Tue, Apr 20, 2004 at 04:20:32PM -0700, Jasper Phillips wrote:
> 
> I've been passing around instances of pb.Copyable classes for some time,
> registering them via pb.setCopierForClassTree()...  However, this doesn't
> allow me to pass the classes themselves.
> 
> I dug around in jelly and found jelly.globalSecurity.allowInstancesOf(),
> which seems to do what I want, but makes me nervious as it's pretty
> buried...
> 
> Passing classes seems like a reasonable thing to do, but now I wonder if
> there is some reason that jelly doesn't allow it (except via a buried method
> call)?  Or is this just an accidental misfeature?

Why not just pass the name of the class, and unserialise that as
appropriate?

I'm not a PB expert (or even close), but I always lean towards passing data
rather than code (or code-like things like classes) over remote method calls
when I can :)

-Andrew.





More information about the Twisted-Python mailing list