comment here
This commit is contained in:
12
.CondaPkg/env/lib/python3.11/site-packages/jsons/serializers/default_timedelta.py
vendored
Normal file
12
.CondaPkg/env/lib/python3.11/site-packages/jsons/serializers/default_timedelta.py
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
def default_timedelta_serializer(obj: timedelta, **kwargs) -> float:
|
||||
"""
|
||||
Serialize the given timedelta instance to a float holding the total
|
||||
seconds.
|
||||
:param obj: the timedelta instance that is to be serialized.
|
||||
:param kwargs: not used.
|
||||
:return: ``timedelta`` as a float.
|
||||
"""
|
||||
return obj.total_seconds()
|
||||
Reference in New Issue
Block a user