I have an issue with including other types in the python generated code.
For example creating the two files:
❯ ./test_types.py
t1 <class 'TypeTest.TypeTest.Type1'>
t1 dir ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__swig_destroy__', '__weakref__', 'thisown', 'type1_long']
t2 <class 'TypeTest.TypeTest.Type2'>
t2 dir ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__swig_destroy__', '__weakref__', 'other_type', 'thisown', 'type2_d', 'type2_type1']
t2 d 18.0
t2 t1 1111
other ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__swig_destroy__', '__weakref__', 'other_type', 'thisown']
t2 other ['__class__', '__delattr__', '__delete__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__isabstractmethod__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__set__', '__set_name__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'deleter', 'fdel', 'fget', 'fset', 'getter', 'setter']
other type 10.0
Traceback (most recent call last):
File "/home/jtroeth/software/Fast-DDS-python/fastdds_python_examples/TypesBug/./test_types.py", line 27, in <module>
t2.other_type.other_type = 10.0 #set
AttributeError: 'property' object has no attribute 'other_type'
Setting and getting other_type for struct "other" is okay.
Setting and Getting the variable other_type via TypeTest t2 is invalid.
Hello,
I have an issue with including other types in the python generated code.
For example creating the two files:
TypeTest.idl
OtherType.idl:
Using the test code:
Output:
We can see the dir(other) is okay and has a dict method and shows a double variable "other_type".
dir (t2.other_type) has no dict and is missing the double variable other_type.
Setting and getting other_type for struct "other" is okay.
Setting and Getting the variable other_type via TypeTest t2 is invalid.
Is this the expected behavior?
Thanks