Closed tcalmant closed 6 years ago
After some tests, here are some notes about Data Classes and iPOPO.
The test files are in tests/dataclasses/
, and are not executed during unit tests: they would only work for Python 3.7 and 3.6 with the dataclasses
package.
__init__
method without required argument, which is a requirement for iPOPO.init=False
argument is given to @dataclass
, it is necessary to implement your own __init__
, defining all fields, otherwise generated methods like __repr__
won't work.@Property
, @Requires
, ...) will lose their default value, as the iPOPO decorator redefines them. Other fields are not touched at all.@dataclass
decorator can be used before or after the iPOPO decorators
Python 3.7 introduces Data Classes (PEP-557).
Before the next release of iPOPO, it will be necessary to