Skip to content

Commit

Permalink
chore: changed dict to Mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 27, 2023
1 parent a74c275 commit b46646b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/netius/adapters/memory.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any, BinaryIO, Callable
from typing import Any, BinaryIO, Callable, Mapping

from netius import BaseAdapter

class MemoryAdapter(BaseAdapter):
def __init__(self): ...
def _ensure(self, owner: str) -> dict[str, Any]: ...
def _ensure(self, owner: str) -> Mapping[str, Any]: ...
def _build_close(self, file: BinaryIO, key: str) -> Callable[[], None]: ...
4 changes: 2 additions & 2 deletions src/netius/auth/base.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Literal, NoReturn, PathLike
from typing import Any, Literal, Mapping, NoReturn, PathLike

HashType = Literal["plain", "md5", "sha1", "sha256", "sha512"]

Expand All @@ -7,7 +7,7 @@ class Auth:
@classmethod
def auth(cls, *args, **kwargs) -> bool: ...
@classmethod
def meta(cls, *args, **kwargs) -> dict[str, Any]: ...
def meta(cls, *args, **kwargs) -> Mapping[str, Any]: ...
@classmethod
def auth_assert(cls, *args, **kwargs) -> NoReturn: ...
@classmethod
Expand Down
16 changes: 7 additions & 9 deletions src/netius/auth/memory.pyi
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
from typing import Any
from typing import Any, Mapping

from netius import Auth

class MemoryAuth(Auth):
def __init__(
self, registry: dict[str, Any] | None = ..., *args, **kwargs
): ...
def __init__(self, registry: Mapping[str, Any] | None = ..., *args, **kwargs): ...
@classmethod
def auth(
cls,
username: str,
password: str,
registry: dict[str, Any] | None = ...,
registry: Mapping[str, Any] | None = ...,
*args,
**kwargs
) -> bool: ...
@classmethod
def meta(
cls, username: str, registry: dict[str, Any] | None = ..., *args, **kwargs
) -> dict[str, Any]: ...
cls, username: str, registry: Mapping[str, Any] | None = ..., *args, **kwargs
) -> Mapping[str, Any]: ...
@classmethod
def get_registry(cls) -> dict[str, Any]: ...
def get_registry(cls) -> Mapping[str, Any]: ...
@classmethod
def load_registry(cls) -> dict[str, Any]: ...
def load_registry(cls) -> Mapping[str, Any]: ...
6 changes: 4 additions & 2 deletions src/netius/auth/passwd.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import PathLike
from typing import Mapping, PathLike

from netius import Auth

Expand All @@ -9,5 +9,7 @@ class PasswdAuth(Auth):
cls, username: str, password: str, path: str = ..., *args, **kwargs
) -> bool: ...
@classmethod
def get_passwd(cls, path: PathLike[str], cache: bool = ...) -> dict[str, str]: ...
def get_passwd(
cls, path: PathLike[str], cache: bool = ...
) -> Mapping[str, str]: ...
def auth_i(self, username: str, password: str, *args, **kwargs) -> bool: ...

0 comments on commit b46646b

Please sign in to comment.