Use typing_extensions.Self instead of _typeshed.Self (#9702)

This commit is contained in:
Alex Waygood
2023-02-15 11:32:43 +01:00
committed by GitHub
parent 8cd6d81f15
commit 7180d0223b
140 changed files with 597 additions and 610 deletions

View File

@@ -1,5 +1,5 @@
from _typeshed import Self
from typing import Any
from typing_extensions import Self
class Key:
# Enable when we can use stubs from installed dependencies,
@@ -8,7 +8,7 @@ class Key:
def __init__(self, key, algorithm) -> None: ...
def sign(self, msg: bytes) -> bytes: ...
def verify(self, msg: bytes, sig: bytes) -> bool: ...
def public_key(self: Self) -> Self: ...
def public_key(self) -> Self: ...
def to_pem(self) -> bytes: ...
def to_dict(self) -> dict[str, Any]: ...
def encrypt(self, plain_text: str | bytes, aad: bytes | None = ...) -> tuple[bytes, bytes, bytes | None]: ...

View File

@@ -1,7 +1,7 @@
from _typeshed import Self
from collections.abc import Callable
from hashlib import _Hash
from typing import Any
from typing_extensions import Self
from .base import Key
@@ -20,6 +20,6 @@ class ECDSAECKey(Key):
def sign(self, msg): ...
def verify(self, msg, sig): ...
def is_public(self) -> bool: ...
def public_key(self: Self) -> Self: ...
def public_key(self) -> Self: ...
def to_pem(self): ...
def to_dict(self) -> dict[str, Any]: ...

View File

@@ -1,5 +1,5 @@
from _typeshed import Self
from typing import Any
from typing_extensions import Self
from .base import Key
@@ -20,7 +20,7 @@ class RSAKey(Key):
def sign(self, msg: bytes) -> bytes: ...
def verify(self, msg: bytes, sig: bytes) -> bool: ...
def is_public(self) -> bool: ...
def public_key(self: Self) -> Self: ...
def public_key(self) -> Self: ...
def to_pem(self, pem_format: str = ...) -> bytes: ...
def to_dict(self) -> dict[str, Any]: ...
def wrap_key(self, key_data: bytes) -> bytes: ...