Ok... after some digging I found AsByteArray in another post and can
work with that as per below.
>>> from amfast.encoder import Encoder
>>> from amfast.decoder import Decoder
>>> from amfast.class_def.as_types import AsByteArray
>>> enc = Encoder(amf3=True).encode([1, AsByteArray("\x80")])
>>> dec = Decoder(amf3=True).decode(enc)
>>> dec
[1, <amfast.class_def.as_types.AsByteArray object at 0x7ffc207e3b90>]
>>> dec[1] = dec[1].bytes
>>> dec == [1, "\x80"]
True
An option in Decoder.__init__ to decode to AMF3 ByteArrays directly to
non-unicode strings (rather than to AsByteArray instances and needing
to reference .bytes) would be awesome. I've looked into decoder.c and
see where to do it for myself, but will hold off on a patch until I
recover from the willies induced by Py_INCREF/Py_DECREF. I've not
done a direct extension yet (cython is just to easy).