mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Update typing_extensions imports in infrastructure and tests (#11243)
This commit is contained in:
@@ -2,8 +2,8 @@ from __future__ import annotations
|
||||
|
||||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
from typing import Any
|
||||
from typing_extensions import Literal, assert_type
|
||||
from typing import Any, Literal
|
||||
from typing_extensions import assert_type
|
||||
|
||||
# See #7163
|
||||
assert_type(pow(1, 0), Literal[1])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, List, Union
|
||||
from typing_extensions import Literal, assert_type
|
||||
from typing import Any, List, Literal, Union
|
||||
from typing_extensions import assert_type
|
||||
|
||||
|
||||
class Foo:
|
||||
|
||||
@@ -2,8 +2,8 @@ from __future__ import annotations
|
||||
|
||||
import enum
|
||||
import sys
|
||||
from typing import Type
|
||||
from typing_extensions import Literal, assert_type
|
||||
from typing import Literal, Type
|
||||
from typing_extensions import assert_type
|
||||
|
||||
A = enum.Enum("A", "spam eggs bacon")
|
||||
B = enum.Enum("B", ["spam", "eggs", "bacon"])
|
||||
|
||||
@@ -5,7 +5,8 @@ from collections.abc import Iterator, Mapping
|
||||
from datetime import datetime, timedelta
|
||||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
from typing_extensions import TypedDict, assert_type
|
||||
from typing import TypedDict
|
||||
from typing_extensions import assert_type
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
case = unittest.TestCase()
|
||||
|
||||
@@ -10,8 +10,22 @@ import math
|
||||
import operator
|
||||
import sys
|
||||
from itertools import chain, combinations, count, cycle, filterfalse, groupby, islice, product, repeat, starmap, tee, zip_longest
|
||||
from typing import Any, Callable, Collection, Hashable, Iterable, Iterator, Sequence, Tuple, Type, TypeVar, Union, overload
|
||||
from typing_extensions import Literal, TypeAlias, TypeVarTuple, Unpack
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Collection,
|
||||
Hashable,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Literal,
|
||||
Sequence,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T1 = TypeVar("_T1")
|
||||
|
||||
@@ -10,8 +10,8 @@ import urllib.parse
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import NamedTuple
|
||||
from typing_extensions import Annotated, Final, TypeGuard, final
|
||||
from typing import Final, NamedTuple, final
|
||||
from typing_extensions import Annotated, TypeGuard
|
||||
|
||||
import tomli
|
||||
from packaging.requirements import Requirement
|
||||
|
||||
Reference in New Issue
Block a user