mirror of https://github.com/tiangolo/fastapi.git
Faster isoformat encoding
This commit is contained in:
parent
657009ada8
commit
253686f2ef
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue