Skip to content

Commit

Permalink
Remove some unnecessary imports of typing.Type (#13469)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Aug 21, 2022
1 parent 2ba6451 commit adb36bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions misc/proper_plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Callable, Type as typing_Type
from typing import Callable

from mypy.nodes import TypeInfo
from mypy.plugin import FunctionContext, Plugin
Expand Down Expand Up @@ -161,5 +161,5 @@ def get_proper_type_instance(ctx: FunctionContext) -> Instance:
return Instance(proper_type_info.node, [])


def plugin(version: str) -> typing_Type[ProperTypePlugin]:
def plugin(version: str) -> type[ProperTypePlugin]:
return ProperTypePlugin
4 changes: 2 additions & 2 deletions mypy/typeops.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from __future__ import annotations

import itertools
from typing import Any, Iterable, List, Sequence, Type as TypingType, TypeVar, cast
from typing import Any, Iterable, List, Sequence, TypeVar, cast

from mypy.copytype import copy_type
from mypy.expandtype import expand_type, expand_type_by_instance
Expand Down Expand Up @@ -741,7 +741,7 @@ def try_getting_int_literals_from_type(typ: Type) -> list[int] | None:


def try_getting_literals_from_type(
typ: Type, target_literal_type: TypingType[T], target_fullname: str
typ: Type, target_literal_type: type[T], target_fullname: str
) -> list[T] | None:
"""If the given expression or type corresponds to a Literal or
union of Literals where the underlying values correspond to the given
Expand Down

0 comments on commit adb36bf

Please sign in to comment.