mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Support calling eval and ast module with unicode in Python 2 (#1440)
This commit is contained in:
committed by
Jelle Zijlstra
parent
d3f9c55203
commit
31d7393cae
@@ -939,7 +939,7 @@ class UnicodeWarning(Warning): ...
|
||||
class BytesWarning(Warning): ...
|
||||
class ResourceWarning(Warning): ...
|
||||
|
||||
def eval(s: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> Any: ...
|
||||
def eval(s: Union[str, unicode], globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> Any: ...
|
||||
def exec(object: str,
|
||||
globals: Optional[Dict[str, Any]] = None,
|
||||
locals: Optional[Dict[str, Any]] = None) -> Any: ... # TODO code object as source
|
||||
|
||||
@@ -21,7 +21,7 @@ __version__ = ... # type: str
|
||||
PyCF_ONLY_AST = ... # type: int
|
||||
|
||||
|
||||
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> Module: ...
|
||||
def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ...
|
||||
def copy_location(new_node: AST, old_node: AST) -> AST: ...
|
||||
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
|
||||
def fix_missing_locations(node: AST) -> AST: ...
|
||||
@@ -29,7 +29,7 @@ def get_docstring(node: AST, clean: bool = ...) -> str: ...
|
||||
def increment_lineno(node: AST, n: int = ...) -> AST: ...
|
||||
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
|
||||
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
|
||||
def literal_eval(node_or_string: Union[str, AST]) -> Any: ...
|
||||
def literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ...
|
||||
def walk(node: AST) -> Iterator[AST]: ...
|
||||
|
||||
class NodeVisitor():
|
||||
|
||||
Reference in New Issue
Block a user