mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-21 03:11:16 +08:00
Add __hash__ for a bunch of types that set it to None (#13286)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Callable, Iterator
|
||||
from email.message import Message
|
||||
from typing import Final, overload
|
||||
from typing import ClassVar, Final, overload
|
||||
|
||||
__all__ = ["Charset", "add_alias", "add_charset", "add_codec"]
|
||||
|
||||
@@ -24,6 +24,7 @@ class Charset:
|
||||
def body_encode(self, string: None) -> None: ...
|
||||
@overload
|
||||
def body_encode(self, string: str | bytes) -> str: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, value: object, /) -> bool: ...
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Iterable
|
||||
from email.charset import Charset
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
|
||||
__all__ = ["Header", "decode_header", "make_header"]
|
||||
|
||||
@@ -16,6 +16,7 @@ class Header:
|
||||
) -> None: ...
|
||||
def append(self, s: bytes | bytearray | str, charset: Charset | str | None = None, errors: str = "strict") -> None: ...
|
||||
def encode(self, splitchars: str = ";, \t", maxlinelen: int | None = None, linesep: str = "\n") -> str: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, value: object, /) -> bool: ...
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ class Address:
|
||||
def __init__(
|
||||
self, display_name: str = "", username: str | None = "", domain: str | None = "", addr_spec: str | None = None
|
||||
) -> None: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class Group:
|
||||
@@ -175,4 +176,5 @@ class Group:
|
||||
@property
|
||||
def addresses(self) -> tuple[Address, ...]: ...
|
||||
def __init__(self, display_name: str | None = None, addresses: Iterable[Address] | None = None) -> None: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user