[Twisted-Python] Foolscap: CopyableSlicer has no streamable attribute?

Hi all. I'm using Foolscap in a project with many disparate types and am gradually learning all the ins and outs of sending these all over the place. I've got an exception occurring that is stumping me. I think it may be a bug in Foolscap, but I don't know enough about the inner workings to be sure. The error is: 'CopyableSlicer' object has no attribute 'streamable' Which occurs here (I'm using SVN Foolscap, BTW):
So the error happened when trying to access topSlicer.streamable, and indeed, dir() shows there is no such attribute on the object, which is of type CopyableSlicer. Now, CopyableSlicer is defined like this: class CopyableSlicer(slicer.BaseSlicer): """I handle ICopyable objects (things which are copied by value).""" def slice(self, streamable, banana): yield 'copyable' copytype = self.obj.getTypeToCopy() assert isinstance(copytype, str) yield copytype state = self.obj.getStateToCopy() for k,v in state.iteritems(): yield k yield v def describe(self): return "<%s>" % self.obj.getTypeToCopy() registerAdapter(CopyableSlicer, ICopyable, tokens.ISlicer) So it overrides slicer.BaseSlicer.slice(). Now, in slicer.BaseSlicer, we see: class BaseSlicer: __metaclass__ = SlicerClass implements(tokens.ISlicer) .... def slice(self, streamable, banana): # this is what makes us ISlicer self.streamable = streamable assert self.opentype for o in self.opentype: yield o for t in self.sliceBody(streamable, banana): yield t Note the line following the comment, "# this is what makes us ISlicer" sets a 'streamable' attribute on the object in the base class, but the subclass doesn't preserve this behaviour. Is this a bug, or is my exception being caused by something else? Regards, Ricky
participants (1)
-
kgi