Skip to content

Commit

Permalink
Improve type hints for Mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
Merinorus committed Feb 10, 2023
1 parent 38e1de7 commit 0a55f95
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pydantic_i18n/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import json
import re
from typing import Any, Callable, Dict, List, Pattern, Sequence, Union
from typing import Any, Callable, Dict, List, Pattern, Sequence, Union, TYPE_CHECKING

from .loaders import BaseLoader, DictLoader

if TYPE_CHECKING:
from pydantic.error_wrappers import ErrorDict

__all__ = ("PydanticI18n",)


Expand Down Expand Up @@ -52,9 +55,9 @@ def locales(self) -> Sequence[str]:

def translate(
self,
errors: List[Dict[str, Any]],
errors: List['ErrorDict'],
locale: str,
) -> List[Dict[str, Any]]:
) -> List['ErrorDict']:
return [
{
**error,
Expand Down

0 comments on commit 0a55f95

Please sign in to comment.