mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-07 10:41:29 -04:00
✨ Improve type annotations, add support for mypy --strict, internally and for external packages (#2547)
This commit is contained in:
1 parent
4fdcdf341c
commit
fdb6c9ccc5
43 files changed
+314
-244
No files matched your search
@@ -5,7 +5,7 @@ from fastapi.logger import logger
|
||||
from pydantic import AnyUrl, BaseModel, Field
|
||||
|
||||
try:
|
||||
import email_validator
|
||||
import email_validator # type: ignore
|
||||
|
||||
assert email_validator # make autoflake ignore the unused import
|
||||
from pydantic import EmailStr
|
||||
@@ -13,7 +13,7 @@ except ImportError: # pragma: no cover
|
||||
|
||||
class EmailStr(str): # type: ignore
|
||||
@classmethod
|
||||
def __get_validators__(cls) -> Iterable[Callable]:
|
||||
def __get_validators__(cls) -> Iterable[Callable[..., Any]]:
|
||||
yield cls.validate
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user