mirror of https://github.com/tiangolo/fastapi.git
Use forward reference instead of py311+ `Self`
This commit is contained in:
parent
dd9ccda841
commit
59b5245ed4
|
|
@ -5,7 +5,6 @@ from typing import (
|
|||
Dict,
|
||||
Iterable,
|
||||
Optional,
|
||||
Self,
|
||||
Type,
|
||||
TypeVar,
|
||||
cast,
|
||||
|
|
@ -75,8 +74,8 @@ class UploadFile(StarletteUploadFile):
|
|||
|
||||
@classmethod
|
||||
def from_starlette(
|
||||
cls: type[Self], starlette_uploadfile: StarletteUploadFile
|
||||
) -> Self:
|
||||
cls: type["UploadFile"], starlette_uploadfile: StarletteUploadFile
|
||||
) -> "UploadFile":
|
||||
return cls(
|
||||
file=starlette_uploadfile.file,
|
||||
size=starlette_uploadfile.size,
|
||||
|
|
|
|||
Loading…
Reference in New Issue