mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Use Literal in a few more places (#3176)
This commit is contained in:
committed by
Jelle Zijlstra
parent
c579f91077
commit
628eee29f7
@@ -1,12 +1,9 @@
|
||||
# Python 3.5 ast
|
||||
|
||||
import sys
|
||||
# Rename typing to _typing, as not to conflict with typing imported
|
||||
# from _ast below when loaded in an unorthodox way by the Dropbox
|
||||
# internal Bazel integration.
|
||||
import typing as _typing
|
||||
from typing import overload, Any, Iterator, Optional, Union, TypeVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
# The same unorthodox Bazel integration causes issues with sys, which
|
||||
# is imported in both modules. unfortunately we can't just rename sys,
|
||||
@@ -14,6 +11,11 @@ from typing_extensions import Literal
|
||||
# sys.
|
||||
from _ast import * # type: ignore
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Literal
|
||||
else:
|
||||
from typing_extensions import Literal
|
||||
|
||||
class NodeVisitor():
|
||||
def visit(self, node: AST) -> Any: ...
|
||||
def generic_visit(self, node: AST) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user