Faster isoformat encoding

This commit is contained in:
Kamil Monicz 2024-03-07 14:15:31 +01:00
parent 657009ada8
commit 253686f2ef
No known key found for this signature in database
GPG Key ID: F9FB19F1C1DC9C23
1 changed files with 1 additions and 4 deletions

View File

@ -27,10 +27,7 @@ from typing_extensions import Annotated, Doc # type: ignore [attr-defined]
from ._compat import PYDANTIC_V2, Url, _model_dump
# Taken from Pydantic v1 as is
def isoformat(o: Union[datetime.date, datetime.time]) -> str:
return o.isoformat()
isoformat: Callable[[Union[datetime.date, datetime.time]], str] = methodcaller("isoformat")
# Taken from Pydantic v1 as is