comment here
This commit is contained in:
14
.CondaPkg/env/lib/python3.11/site-packages/jsons/deserializers/default_timedelta.py
vendored
Normal file
14
.CondaPkg/env/lib/python3.11/site-packages/jsons/deserializers/default_timedelta.py
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
def default_timedelta_deserializer(obj: float,
|
||||
cls: type = float,
|
||||
**kwargs) -> timedelta:
|
||||
"""
|
||||
Deserialize a float to a timedelta instance.
|
||||
:param obj: the float that is to be deserialized.
|
||||
:param cls: not used.
|
||||
:param kwargs: not used.
|
||||
:return: a ``datetime.timedelta`` instance.
|
||||
"""
|
||||
return timedelta(seconds=obj)
|
||||
Reference in New Issue
Block a user