-
-
Notifications
You must be signed in to change notification settings - Fork 646
Open
Labels
Description
The docstring is correct:
:param precision: The time unit used for (de)serialization. Must be one of 'weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds' or 'microseconds'.
it's the units (de)serialised to; it doesn't effect precision.
That is, 123 microseconds with the default "seconds" precision will serialise to 0.000123, not 0.
This seems to be a breaking change in v4.0.0, perhaps somehow related to the date/time/isoformat change, I think in 0c90110 as previously it would return a timedelta(microseconds=123) in the _serialize method, but now returns a float via utils.timedelta_to_microseconds divided by the 'precision''s mapping value, i.e. 1000000 for seconds.