property-setter functions do not work
Brought to you by:
elie
PYASN1: Version 0.1.9
PYTHON: 2.7.x
The following property-setter function will never be called:
class Example(univ.Sequence):
componentType = namedtype.NamedTypes(
namedtype.NamedType("number", univ.Integer(0)),
)
@property
def number(self):
return int(self.getComponentByName("number"))
@number.setter
def number(self, value):
self.setComponentByName("number", value)
The problem is caused by "pyasn1.type.base.Asn1Item" that is not derived from object.
If you make the following change, everything will work:
# -- FILE: pyasn1/type/base.py
class Asn1Item(object): pass
WORKAROUNG (until problem is fixed):
# USE-THIS: Add "object" to inherited base-classes (but not on first position).
class Example(univ.Sequence, object):
...