1
1
import sys
2
2
from _typeshed import SupportsGetItem , SupportsItemAccess
3
3
from builtins import type as _type
4
- from typing import IO , Any , AnyStr , Dict , Iterable , Iterator , List , Mapping , Optional , Protocol , Tuple , TypeVar , Union
4
+ from typing import IO , Any , AnyStr , Iterable , Iterator , Mapping , Optional , Protocol , TypeVar , Union
5
5
6
6
_T = TypeVar ("_T" , bound = FieldStorage )
7
7
@@ -10,28 +10,28 @@ def parse(
10
10
environ : SupportsItemAccess [str , str ] = ...,
11
11
keep_blank_values : bool = ...,
12
12
strict_parsing : bool = ...,
13
- ) -> Dict [str , List [str ]]: ...
13
+ ) -> dict [str , list [str ]]: ...
14
14
15
15
if sys .version_info < (3 , 8 ):
16
- def parse_qs (qs : str , keep_blank_values : bool = ..., strict_parsing : bool = ...) -> Dict [str , List [str ]]: ...
17
- def parse_qsl (qs : str , keep_blank_values : bool = ..., strict_parsing : bool = ...) -> List [ Tuple [str , str ]]: ...
16
+ def parse_qs (qs : str , keep_blank_values : bool = ..., strict_parsing : bool = ...) -> dict [str , list [str ]]: ...
17
+ def parse_qsl (qs : str , keep_blank_values : bool = ..., strict_parsing : bool = ...) -> list [ tuple [str , str ]]: ...
18
18
19
19
if sys .version_info >= (3 , 7 ):
20
20
def parse_multipart (
21
21
fp : IO [Any ], pdict : SupportsGetItem [str , bytes ], encoding : str = ..., errors : str = ...
22
- ) -> Dict [str , List [Any ]]: ...
22
+ ) -> dict [str , list [Any ]]: ...
23
23
24
24
else :
25
- def parse_multipart (fp : IO [Any ], pdict : SupportsGetItem [str , bytes ]) -> Dict [str , List [bytes ]]: ...
25
+ def parse_multipart (fp : IO [Any ], pdict : SupportsGetItem [str , bytes ]) -> dict [str , list [bytes ]]: ...
26
26
27
27
class _Environ (Protocol ):
28
28
def __getitem__ (self , __k : str ) -> str : ...
29
29
def keys (self ) -> Iterable [str ]: ...
30
30
31
- def parse_header (line : str ) -> Tuple [str , Dict [str , str ]]: ...
31
+ def parse_header (line : str ) -> tuple [str , dict [str , str ]]: ...
32
32
def test (environ : _Environ = ...) -> None : ...
33
33
def print_environ (environ : _Environ = ...) -> None : ...
34
- def print_form (form : Dict [str , Any ]) -> None : ...
34
+ def print_form (form : dict [str , Any ]) -> None : ...
35
35
def print_directory () -> None : ...
36
36
def print_environ_usage () -> None : ...
37
37
@@ -47,15 +47,17 @@ class MiniFieldStorage:
47
47
list : Any
48
48
type : Any
49
49
file : Optional [IO [bytes ]]
50
- type_options : Dict [Any , Any ]
50
+ type_options : dict [Any , Any ]
51
51
disposition : Any
52
- disposition_options : Dict [Any , Any ]
53
- headers : Dict [Any , Any ]
52
+ disposition_options : dict [Any , Any ]
53
+ headers : dict [Any , Any ]
54
54
name : Any
55
55
value : Any
56
56
def __init__ (self , name : Any , value : Any ) -> None : ...
57
57
def __repr__ (self ) -> str : ...
58
58
59
+ _list = list
60
+
59
61
class FieldStorage (object ):
60
62
FieldStorageClass : Optional [_type ]
61
63
keep_blank_values : int
@@ -69,16 +71,16 @@ class FieldStorage(object):
69
71
bytes_read : int
70
72
limit : Optional [int ]
71
73
disposition : str
72
- disposition_options : Dict [str , str ]
74
+ disposition_options : dict [str , str ]
73
75
filename : Optional [str ]
74
76
file : Optional [IO [bytes ]]
75
77
type : str
76
- type_options : Dict [str , str ]
78
+ type_options : dict [str , str ]
77
79
innerboundary : bytes
78
80
length : int
79
81
done : int
80
- list : Optional [List [Any ]]
81
- value : Union [None , bytes , List [Any ]]
82
+ list : Optional [_list [Any ]]
83
+ value : Union [None , bytes , _list [Any ]]
82
84
83
85
if sys .version_info >= (3 , 6 ):
84
86
def __init__ (
@@ -125,8 +127,8 @@ class FieldStorage(object):
125
127
def __getitem__ (self , key : str ) -> Any : ...
126
128
def getvalue (self , key : str , default : Any = ...) -> Any : ...
127
129
def getfirst (self , key : str , default : Any = ...) -> Any : ...
128
- def getlist (self , key : str ) -> List [Any ]: ...
129
- def keys (self ) -> List [str ]: ...
130
+ def getlist (self , key : str ) -> _list [Any ]: ...
131
+ def keys (self ) -> _list [str ]: ...
130
132
if sys .version_info < (3 , 0 ):
131
133
def has_key (self , key : str ) -> bool : ...
132
134
def __contains__ (self , key : str ) -> bool : ...
@@ -144,7 +146,7 @@ class FieldStorage(object):
144
146
145
147
if sys .version_info < (3 , 0 ):
146
148
from UserDict import UserDict
147
- class FormContentDict (UserDict [str , List [str ]]):
149
+ class FormContentDict (UserDict [str , list [str ]]):
148
150
query_string : str
149
151
def __init__ (self , environ : Mapping [str , str ] = ..., keep_blank_values : int = ..., strict_parsing : int = ...) -> None : ...
150
152
class SvFormContentDict (FormContentDict ):
@@ -159,4 +161,4 @@ if sys.version_info < (3, 0):
159
161
def value (self , key : Any ) -> Any : ...
160
162
def length (self , key : Any ) -> int : ...
161
163
def stripped (self , key : Any ) -> Any : ...
162
- def pars (self ) -> Dict [Any , Any ]: ...
164
+ def pars (self ) -> dict [Any , Any ]: ...
0 commit comments