mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Re-export code from _ast into ast. (#1515)
After mypy [started hiding](https://github.com/python/mypy/pull/3706) imported names in stubs unless `from ... import ...` is used, we found an error with stubs of ast module. It looks like ast module should re-export everything in `_ast` and according to PEP 484, it can do that by doing `from _ast import *`, so this is what this PR does.
This commit is contained in:
committed by
Guido van Rossum
parent
a249b40a6d
commit
3f9fafbbb7
@@ -3,20 +3,7 @@
|
||||
import typing
|
||||
from typing import Any, Union, Iterator
|
||||
|
||||
from _ast import (
|
||||
Add, alias, And, arg, arguments, Assert, Assign, AST, AsyncFor,
|
||||
AsyncFunctionDef, AsyncWith, Attribute, AugAssign, AugLoad, AugStore,
|
||||
Await, BinOp, BitAnd, BitOr, BitXor, BoolOp, boolop, Break, Bytes, Call,
|
||||
ClassDef, cmpop, Compare, comprehension, Continue, Del, Delete, Dict,
|
||||
DictComp, Div, Ellipsis, Eq, ExceptHandler, Expr, expr, Expression,
|
||||
expr_context, ExtSlice, FloorDiv, For, FunctionDef, GeneratorExp, Global,
|
||||
Gt, GtE, If, IfExp, Import, ImportFrom, In, Index, Interactive, Invert, Is,
|
||||
IsNot, keyword, Lambda, List, ListComp, Load, LShift, Lt, LtE, MatMult,
|
||||
Mod, mod, Module, Mult, Name, NameConstant, Nonlocal, Not, NotEq, NotIn,
|
||||
Num, operator, Or, Param, Pass, Pow, Raise, Return, RShift, Set, SetComp,
|
||||
Slice, slice, Starred, stmt, Store, Str, Sub, Subscript, Suite, Try, Tuple,
|
||||
UAdd, UnaryOp, unaryop, USub, While, With, withitem, Yield, YieldFrom
|
||||
)
|
||||
from _ast import *
|
||||
|
||||
class NodeVisitor():
|
||||
def visit(self, node: AST) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user