wrenoud / structobject

A verbose pythonic semantic for describing binary data structures and associated python objects.
Apache License 2.0
1 stars 0 forks source link

attribute assignment during structObject.__init__ for overloaded structures #1

Closed wrenoud closed 10 years ago

wrenoud commented 10 years ago

Using the BoundingBoxDatagram example from the readme I get the following error when trying to set the timestamp during initialization of an object instance.

>>> p = BoundingBoxDatagram(timestamp=time())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "structObject.py", line 153, in __init__
    self._values.append(constructor(self))
  File "structObject.py", line 151, in __init__
    raise TypeError("'{}' must be of type '{}', given '{}'".format(name,constructor.__name__, value.__class__.__name__))
TypeError: 'northwest' must be of type 'Point', given 'BoundingBoxDatagram'