mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add __all__ for modules beginning with 'h' and 'i' (#7327)
This commit is contained in:
@@ -3,6 +3,27 @@ from _typeshed import ReadableBuffer, Self
|
||||
from typing import AbstractSet
|
||||
from typing_extensions import final
|
||||
|
||||
__all__ = (
|
||||
"md5",
|
||||
"sha1",
|
||||
"sha224",
|
||||
"sha256",
|
||||
"sha384",
|
||||
"sha512",
|
||||
"blake2b",
|
||||
"blake2s",
|
||||
"sha3_224",
|
||||
"sha3_256",
|
||||
"sha3_384",
|
||||
"sha3_512",
|
||||
"shake_128",
|
||||
"shake_256",
|
||||
"new",
|
||||
"algorithms_guaranteed",
|
||||
"algorithms_available",
|
||||
"pbkdf2_hmac",
|
||||
)
|
||||
|
||||
class _Hash:
|
||||
@property
|
||||
def digest_size(self) -> int: ...
|
||||
|
||||
@@ -2,6 +2,8 @@ from _heapq import *
|
||||
from _typeshed import SupportsRichComparison
|
||||
from typing import Any, Callable, Iterable, TypeVar
|
||||
|
||||
__all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge", "nlargest", "nsmallest", "heappushpop"]
|
||||
|
||||
_S = TypeVar("_S")
|
||||
|
||||
__about__: str
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from typing import AnyStr
|
||||
|
||||
__all__ = ["escape", "unescape"]
|
||||
|
||||
def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ...
|
||||
def unescape(s: AnyStr) -> AnyStr: ...
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
__all__ = ["html5", "name2codepoint", "codepoint2name", "entitydefs"]
|
||||
|
||||
name2codepoint: dict[str, int]
|
||||
html5: dict[str, str]
|
||||
codepoint2name: dict[int, str]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from _markupbase import ParserBase
|
||||
from typing import Pattern
|
||||
|
||||
__all__ = ["HTMLParser"]
|
||||
|
||||
class HTMLParser(ParserBase):
|
||||
def __init__(self, *, convert_charrefs: bool = ...) -> None: ...
|
||||
def feed(self, data: str) -> None: ...
|
||||
|
||||
@@ -2,6 +2,8 @@ import sys
|
||||
from enum import IntEnum
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["HTTPStatus"]
|
||||
|
||||
class HTTPStatus(IntEnum):
|
||||
@property
|
||||
def phrase(self) -> str: ...
|
||||
|
||||
@@ -7,6 +7,28 @@ from _typeshed import Self, WriteableBuffer
|
||||
from socket import socket
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, TypeVar, Union, overload
|
||||
|
||||
__all__ = [
|
||||
"HTTPResponse",
|
||||
"HTTPConnection",
|
||||
"HTTPException",
|
||||
"NotConnected",
|
||||
"UnknownProtocol",
|
||||
"UnknownTransferEncoding",
|
||||
"UnimplementedFileMode",
|
||||
"IncompleteRead",
|
||||
"InvalidURL",
|
||||
"ImproperConnectionState",
|
||||
"CannotSendRequest",
|
||||
"CannotSendHeader",
|
||||
"ResponseNotReady",
|
||||
"BadStatusLine",
|
||||
"LineTooLong",
|
||||
"RemoteDisconnected",
|
||||
"error",
|
||||
"responses",
|
||||
"HTTPSConnection",
|
||||
]
|
||||
|
||||
_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@@ -4,6 +4,17 @@ from http.client import HTTPResponse
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, TypeVar, overload
|
||||
from urllib.request import Request
|
||||
|
||||
__all__ = [
|
||||
"Cookie",
|
||||
"CookieJar",
|
||||
"CookiePolicy",
|
||||
"DefaultCookiePolicy",
|
||||
"FileCookieJar",
|
||||
"LWPCookieJar",
|
||||
"LoadError",
|
||||
"MozillaCookieJar",
|
||||
]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class LoadError(OSError): ...
|
||||
|
||||
@@ -4,6 +4,8 @@ from typing import Any, Generic, Iterable, Mapping, TypeVar, Union, overload
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
__all__ = ["CookieError", "BaseCookie", "SimpleCookie"]
|
||||
|
||||
_DataType = Union[str, Mapping[str, Union[str, Morsel[Any]]]]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import sys
|
||||
from _typeshed import StrPath, SupportsRead, SupportsWrite
|
||||
from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence
|
||||
|
||||
__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"]
|
||||
|
||||
class HTTPServer(socketserver.TCPServer):
|
||||
server_name: str
|
||||
server_port: int
|
||||
|
||||
@@ -8,6 +8,8 @@ from types import TracebackType
|
||||
from typing import IO, Any, Callable, Pattern, Union
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"]
|
||||
|
||||
# TODO: Commands should use their actual return types, not this type alias.
|
||||
# E.g. Tuple[Literal["OK"], List[bytes]]
|
||||
_CommandResults = tuple[str, list[Any]]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import Any, BinaryIO, Callable, Protocol, overload
|
||||
|
||||
__all__ = ["what"]
|
||||
|
||||
class _ReadableBinary(Protocol):
|
||||
def tell(self) -> int: ...
|
||||
def read(self, size: int) -> bytes: ...
|
||||
|
||||
@@ -2,6 +2,8 @@ from importlib.abc import Loader
|
||||
from types import ModuleType
|
||||
from typing import Mapping, Sequence
|
||||
|
||||
__all__ = ["__import__", "import_module", "invalidate_caches", "reload"]
|
||||
|
||||
# Signature of `builtins.__import__` should be kept identical to `importlib.__import__`
|
||||
def __import__(
|
||||
name: str,
|
||||
|
||||
@@ -5,6 +5,38 @@ from pathlib import Path
|
||||
from types import ModuleType
|
||||
from typing import Any, BinaryIO, Iterator, TextIO, Union
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ = [
|
||||
"Package",
|
||||
"Resource",
|
||||
"ResourceReader",
|
||||
"as_file",
|
||||
"contents",
|
||||
"files",
|
||||
"is_resource",
|
||||
"open_binary",
|
||||
"open_text",
|
||||
"path",
|
||||
"read_binary",
|
||||
"read_text",
|
||||
]
|
||||
elif sys.version_info >= (3, 9):
|
||||
__all__ = [
|
||||
"Package",
|
||||
"Resource",
|
||||
"as_file",
|
||||
"contents",
|
||||
"files",
|
||||
"is_resource",
|
||||
"open_binary",
|
||||
"open_text",
|
||||
"path",
|
||||
"read_binary",
|
||||
"read_text",
|
||||
]
|
||||
else:
|
||||
__all__ = ["Package", "Resource", "contents", "is_resource", "open_binary", "open_text", "path", "read_binary", "read_text"]
|
||||
|
||||
Package = Union[str, ModuleType]
|
||||
Resource = Union[str, os.PathLike[Any]]
|
||||
|
||||
|
||||
@@ -7,6 +7,50 @@ from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, TextIO
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = [
|
||||
"BlockingIOError",
|
||||
"open",
|
||||
"open_code",
|
||||
"IOBase",
|
||||
"RawIOBase",
|
||||
"FileIO",
|
||||
"BytesIO",
|
||||
"StringIO",
|
||||
"BufferedIOBase",
|
||||
"BufferedReader",
|
||||
"BufferedWriter",
|
||||
"BufferedRWPair",
|
||||
"BufferedRandom",
|
||||
"TextIOBase",
|
||||
"TextIOWrapper",
|
||||
"UnsupportedOperation",
|
||||
"SEEK_SET",
|
||||
"SEEK_CUR",
|
||||
"SEEK_END",
|
||||
]
|
||||
else:
|
||||
__all__ = [
|
||||
"BlockingIOError",
|
||||
"open",
|
||||
"IOBase",
|
||||
"RawIOBase",
|
||||
"FileIO",
|
||||
"BytesIO",
|
||||
"StringIO",
|
||||
"BufferedIOBase",
|
||||
"BufferedReader",
|
||||
"BufferedWriter",
|
||||
"BufferedRWPair",
|
||||
"BufferedRandom",
|
||||
"TextIOBase",
|
||||
"TextIOWrapper",
|
||||
"UnsupportedOperation",
|
||||
"SEEK_SET",
|
||||
"SEEK_CUR",
|
||||
"SEEK_END",
|
||||
]
|
||||
|
||||
DEFAULT_BUFFER_SIZE: Literal[8192]
|
||||
|
||||
SEEK_SET: Literal[0]
|
||||
|
||||
Reference in New Issue
Block a user