1
- # Rename typing to _typing, as not to conflict with typing imported
2
- # from _ast below when loaded in an unorthodox way by the Dropbox
3
- # internal Bazel integration.
4
-
5
- # The same unorthodox Bazel integration causes issues with sys, which
6
- # is imported in both modules. unfortunately we can't just rename sys,
7
- # since mypy only supports version checks with a sys that is named
8
- # sys.
9
1
import sys
10
- import typing as _typing
11
2
from _ast import *
12
3
from typing import Any , Iterator , TypeVar , overload
13
4
from typing_extensions import Literal
@@ -166,7 +157,7 @@ if sys.version_info >= (3, 8):
166
157
mode : Literal ["exec" ] = ...,
167
158
* ,
168
159
type_comments : bool = ...,
169
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
160
+ feature_version : None | int | tuple [int , int ] = ...,
170
161
) -> Module : ...
171
162
@overload
172
163
def parse (
@@ -175,7 +166,7 @@ if sys.version_info >= (3, 8):
175
166
mode : Literal ["eval" ],
176
167
* ,
177
168
type_comments : bool = ...,
178
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
169
+ feature_version : None | int | tuple [int , int ] = ...,
179
170
) -> Expression : ...
180
171
@overload
181
172
def parse (
@@ -184,7 +175,7 @@ if sys.version_info >= (3, 8):
184
175
mode : Literal ["func_type" ],
185
176
* ,
186
177
type_comments : bool = ...,
187
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
178
+ feature_version : None | int | tuple [int , int ] = ...,
188
179
) -> FunctionType : ...
189
180
@overload
190
181
def parse (
@@ -193,31 +184,31 @@ if sys.version_info >= (3, 8):
193
184
mode : Literal ["single" ],
194
185
* ,
195
186
type_comments : bool = ...,
196
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
187
+ feature_version : None | int | tuple [int , int ] = ...,
197
188
) -> Interactive : ...
198
189
@overload
199
190
def parse (
200
191
source : str | bytes ,
201
192
* ,
202
193
mode : Literal ["eval" ],
203
194
type_comments : bool = ...,
204
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
195
+ feature_version : None | int | tuple [int , int ] = ...,
205
196
) -> Expression : ...
206
197
@overload
207
198
def parse (
208
199
source : str | bytes ,
209
200
* ,
210
201
mode : Literal ["func_type" ],
211
202
type_comments : bool = ...,
212
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
203
+ feature_version : None | int | tuple [int , int ] = ...,
213
204
) -> FunctionType : ...
214
205
@overload
215
206
def parse (
216
207
source : str | bytes ,
217
208
* ,
218
209
mode : Literal ["single" ],
219
210
type_comments : bool = ...,
220
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
211
+ feature_version : None | int | tuple [int , int ] = ...,
221
212
) -> Interactive : ...
222
213
@overload
223
214
def parse (
@@ -226,7 +217,7 @@ if sys.version_info >= (3, 8):
226
217
mode : str = ...,
227
218
* ,
228
219
type_comments : bool = ...,
229
- feature_version : None | int | _typing . Tuple [int , int ] = ...,
220
+ feature_version : None | int | tuple [int , int ] = ...,
230
221
) -> AST : ...
231
222
232
223
else :
@@ -260,7 +251,7 @@ def fix_missing_locations(node: _T) -> _T: ...
260
251
def get_docstring (node : AST , clean : bool = ...) -> str | None : ...
261
252
def increment_lineno (node : _T , n : int = ...) -> _T : ...
262
253
def iter_child_nodes (node : AST ) -> Iterator [AST ]: ...
263
- def iter_fields (node : AST ) -> Iterator [_typing . Tuple [str , Any ]]: ...
254
+ def iter_fields (node : AST ) -> Iterator [tuple [str , Any ]]: ...
264
255
def literal_eval (node_or_string : str | AST ) -> Any : ...
265
256
266
257
if sys .version_info >= (3 , 8 ):
0 commit comments