mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Literal: always import from typing_extensions for simplicity (#4219)
This commit is contained in:
@@ -4,6 +4,7 @@ import sys
|
||||
# internal Bazel integration.
|
||||
import typing as _typing
|
||||
from typing import Any, Iterator, Optional, TypeVar, Union, overload
|
||||
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,
|
||||
@@ -11,12 +12,6 @@ from typing import Any, Iterator, Optional, TypeVar, Union, overload
|
||||
# sys.
|
||||
from _ast import * # type: ignore
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Literal
|
||||
else:
|
||||
from typing_extensions import Literal
|
||||
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class Num(Constant): ...
|
||||
class Str(Constant): ...
|
||||
|
||||
Reference in New Issue
Block a user