Add __all__ for modules beginning with 'h' and 'i' (#7327)

This commit is contained in:
Alex Waygood
2022-02-20 22:01:45 +00:00
committed by GitHub
parent 2279c87257
commit 8f2f857ffc
15 changed files with 150 additions and 0 deletions

View File

@@ -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: ...

View File

@@ -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")

View File

@@ -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): ...

View File

@@ -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")

View File

@@ -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