You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiplying a relativedelta with non-integer day values (e.g. relativedelta(days=+1.5) converts to integer values of days, losing information in the process.
The cause appears to be applying a blanket int() to the results of the multiplication L495, without checking to see if fractional days should be converted down into hours/seconds etc.
Is this intended behaviour? Currently relativedelta accepts non-integer values for days (as does the python standard library), so my current assumption is that it should mirror the behaviour from datetime and convert fractional days.
Multiplying a
relativedelta
with non-integer day values (e.g.relativedelta(days=+1.5)
converts to integer values of days, losing information in the process.The cause appears to be applying a blanket
int()
to the results of the multiplication L495, without checking to see if fractional days should be converted down into hours/seconds etc.Is this intended behaviour? Currently
relativedelta
accepts non-integer values for days (as does the python standard library), so my current assumption is that it should mirror the behaviour fromdatetime
and convert fractional days.Minimal reproducible example:
By contrast,
datetime.timedelta
from the standard library does not lose the half-day:Dateutil version:
2.8.2
Python version:
3.10.4
The text was updated successfully, but these errors were encountered: