hydralabs/pyamf — pull request #17 by IMDagger (2012-04-28 00:44:10+00:00)
Title: Sysnonyms trouble

Synonyms works during encoding, but doesn't work properly after decoding.

```python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyamf
>>> class X(object):
... class __amf__:
... synonym = {'backend_var': 'flashVar'}
... def __init__(self, value):
... self.backend_var = value
...
>>> pyamf.register_class(X, 'X')
@ 0x1119d90>
>>> pyamf.encode(X('test')).read()
'\n\x0b\x03X\x11flashVar\x06\ttest\x01'
>>> data = pyamf.encode(X('test')).read()
>>> list(pyamf.decode(data))[0]
<__main__.X object at 0x10f2550>
>>> list(pyamf.decode(data))[0].flashVar
u'test'
>>> list(pyamf.decode(data))[0].backend_var
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'X' object has no attribute 'backend_var'
```