8000 Add http.HTTPMethod for 3.11 · python/typeshed@136f268 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 136f268

Browse files
Add http.HTTPMethod for 3.11
python/cpython#91997
1 parent e8b3619 commit 136f268

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

stdlib/http/__init__.pyi

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,22 @@ import sys
22
from enum import IntEnum
33
from typing_extensions import Literal
44

5-
__all__ = ["HTTPStatus"]
5+
if sys.version_info >= (3, 11):
6+
__all__ = ["HTTPStatus", "HTTPMethod"]
7+
else:
8+
__all__ = ["HTTPStatus"]
9+
10+
if sys.version_info >= (3, 11):
11+
class HTTPMethod(StrEnum):
12+
GET: str
13+
HEAD: str
14+
POST: str
15+
PUT: str
16+
DELETE: str
17+
CONNECT: str
18+
OPTIONS: str
19+
TRACE: str
20+
PATCH: str
621

722
class HTTPStatus(IntEnum):
823
@property

0 commit comments

Comments
 (0)
0