Skip to content

Commit 0b98780

Browse files
authored
Add new http.HTTPStatus/__init__.pyi for Python3.12 (#10296)
1 parent 0aa5dd5 commit 0b98780

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Diff for: stdlib/http/__init__.pyi

+11
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ class HTTPStatus(IntEnum):
7979
EARLY_HINTS: Literal[103]
8080
IM_A_TEAPOT: Literal[418]
8181
TOO_EARLY: Literal[425]
82+
if sys.version_info >= (3, 12):
83+
@property
84+
def is_informational(self) -> bool: ...
85+
@property
86+
def is_success(self) -> bool: ...
87+
@property
88+
def is_redirection(self) -> bool: ...
89+
@property
90+
def is_client_error(self) -> bool: ...
91+
@property
92+
def is_server_error(self) -> bool: ...
8293

8394
if sys.version_info >= (3, 11):
8495
class HTTPMethod(StrEnum):

Diff for: tests/stubtest_allowlists/py312.txt

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ enum.property.member
3030
genericpath.__all__
3131
genericpath.islink
3232
gzip.GzipFile.filename
33-
http.HTTPStatus.is_client_error
34-
http.HTTPStatus.is_informational
35-
http.HTTPStatus.is_redirection
36-
http.HTTPStatus.is_server_error
37-
http.HTTPStatus.is_success
3833
http.client.HTTPConnection.get_proxy_response_headers
3934
http.client.HTTPSConnection.__init__
4035
imaplib.IMAP4_SSL.__init__

0 commit comments

Comments
 (0)