Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 2, 2024
1 parent a1044a4 commit de02d06
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions sqlalchemy_file/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import typing
from typing import Any, overload, Literal, override

from typing import Any, Literal, overload, override

STR_ATTRS = Literal[
"url",
Expand Down Expand Up @@ -28,38 +27,48 @@ class BaseFile(typing.Dict[str, Any]):
"""

@overload
def __getitem__(self, key: STR_ATTRS) -> str: ...
def __getitem__(self, key: STR_ATTRS) -> str:
...

@overload
def __getitem__(self, key: INT_ATTRS) -> int: ...
def __getitem__(self, key: INT_ATTRS) -> int:
...

@overload
def __getitem__(self, key: DICT_ATTRS) -> dict[str, str]: ...
def __getitem__(self, key: DICT_ATTRS) -> dict[str, str]:
...

@overload
def __getitem__(self, key: STR_LIST_ATTRS) -> list[str]: ...
def __getitem__(self, key: STR_LIST_ATTRS) -> list[str]:
...

@overload
def __getitem__(self, key: BOOL_ATTRS) -> bool: ...
def __getitem__(self, key: BOOL_ATTRS) -> bool:
...

@override
def __getitem__(self, key: str) -> Any:
return dict.__getitem__(self, key)

@overload
def __getattr__(self, name: STR_ATTRS) -> str: ...
def __getattr__(self, name: STR_ATTRS) -> str:
...

@overload
def __getattr__(self, name: INT_ATTRS) -> int: ...
def __getattr__(self, name: INT_ATTRS) -> int:
...

@overload
def __getattr__(self, name: DICT_ATTRS) -> dict[str, str]: ...
def __getattr__(self, name: DICT_ATTRS) -> dict[str, str]:
...

@overload
def __getattr__(self, name: STR_LIST_ATTRS) -> list[str]: ...
def __getattr__(self, name: STR_LIST_ATTRS) -> list[str]:
...

@overload
def __getattr__(self, name: BOOL_ATTRS) -> bool: ...
def __getattr__(self, name: BOOL_ATTRS) -> bool:
...

def __getattr__(self, name: str) -> Any:
try:
Expand Down

0 comments on commit de02d06

Please sign in to comment.