[Twisted-Python] AMP Argument.toBox's proto argument is a locator, not the proto?

Glyph glyph at twistedmatrix.com
Mon Sep 30 12:41:52 MDT 2013


On Sep 30, 2013, at 2:45 AM, Laurens Van Houtven <_ at lvh.io> wrote:

> What am I doing wrong? Is this a bug?

I think it's pretty clearly a bug.  Calling the argument "proto" in the first place indicates the nature of the confusion.

There are parts of the flow here from bytes to method execution and back (like _wrapWithSerialization) which are nice for composition, but the fact that they're private sort of ruins their utility for extensibility.

Looking at the code you're trying to write in txampext though, the problem appears to be simply that you're writing functionality close enough to AMP's core that you should be making the changes to AMP directly, and fixing the issue by making changes to AMP itself rather than trying to work around it externally.  The way I was going to recommend fixing it before I clicked on your link was by writing something like ExposingArgument and accessing the locator/receiver/sender via that new API rather than via the 'proto' argument at all :)

-glyph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20130930/523e2617/attachment-0002.html>


More information about the Twisted-Python mailing list