-
Couldn't load subscription status.
- Fork 4
Closed as not planned
Labels
resolution:wontfixThis will not be worked onThis will not be worked on
Milestone
Description
What's needed?
from frequenz.quantities import Power
from collections import deque
power1 = Power.from_watts(230.0)
power2 = Power.from_watts(240.0)
power_deque = deque([power1, power2])
sum(power_deque)
This code stops with this error TypeError: unsupported operand type(s) for +: 'int' and 'Power'
Proposed solution
The reason is that the sum starts with an integer 0. This we need to implement the __add__ method for quantities that excepts integers.
Use cases
No response
Alternatives and workarounds
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
resolution:wontfixThis will not be worked onThis will not be worked on