From 0b98780c81baf1fd4d1b09294af9d2e4675c1adb Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sat, 10 Jun 2023 12:34:28 +0300 Subject: [PATCH] Add new `http.HTTPStatus/__init__.pyi` for Python3.12 (#10296) --- stdlib/http/__init__.pyi | 11 +++++++++++ tests/stubtest_allowlists/py312.txt | 5 ----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/stdlib/http/__init__.pyi b/stdlib/http/__init__.pyi index d4b44f2eb..4310c79b9 100644 --- a/stdlib/http/__init__.pyi +++ b/stdlib/http/__init__.pyi @@ -79,6 +79,17 @@ class HTTPStatus(IntEnum): EARLY_HINTS: Literal[103] IM_A_TEAPOT: Literal[418] TOO_EARLY: Literal[425] + if sys.version_info >= (3, 12): + @property + def is_informational(self) -> bool: ... + @property + def is_success(self) -> bool: ... + @property + def is_redirection(self) -> bool: ... + @property + def is_client_error(self) -> bool: ... + @property + def is_server_error(self) -> bool: ... if sys.version_info >= (3, 11): class HTTPMethod(StrEnum): diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index e3811a782..1b308d94a 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -30,11 +30,6 @@ enum.property.member genericpath.__all__ genericpath.islink gzip.GzipFile.filename -http.HTTPStatus.is_client_error -http.HTTPStatus.is_informational -http.HTTPStatus.is_redirection -http.HTTPStatus.is_server_error -http.HTTPStatus.is_success http.client.HTTPConnection.get_proxy_response_headers http.client.HTTPSConnection.__init__ imaplib.IMAP4_SSL.__init__