On Jul 20, 2012, at 1:11 AM, Laurens Van Houtven <_...@lvh.cc> wrote:

> Hi,
> 
> 
> Apparently AMPBoxes aren't Arguments. However, I kind of want an AMPBox (like 
> an AMPList, but only one).
> 
> Use case: my responses have a "location", but a location is composed of 
> several sub-things: place name, country and postal code. {"location": 
> {"placeName": "Krakow", "countryCode": "PL", postalCode: "30-015"}} would be 
> a lot nicer  than having those keys in the top level namespace :)
> 
> cheers
> lvh

Seems like an easy enough thing to write.  Given that AMPList doesn't use a 
length prefix (it uses null-key box-termination, just like the rest of the 
protocol) the representation would be exactly the same.  Just add a trivial 
wrapper that uses AMPList, unpacks its argument, and assert that there's only 
one of them?

-glyph


_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to