Skip to content

Commit 0849085

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 51bceb7 commit 0849085

21 files changed

+23
-26
lines changed

mypy/binder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from collections import defaultdict
44
from collections.abc import Iterator
55
from contextlib import contextmanager
6-
from typing import NamedTuple, Optional, Union
6+
from typing import NamedTuple
77
from typing_extensions import TypeAlias as _TypeAlias
88

99
from mypy.erasetype import remove_instance_last_known_values

mypy/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
from __future__ import annotations
4949

5050
from collections.abc import Sequence
51-
from typing import Any, Final, Union
51+
from typing import Any, Final
5252
from typing_extensions import TypeAlias as _TypeAlias
5353

5454
from librt.internal import (

mypy/checker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
Generic,
1313
Literal,
1414
NamedTuple,
15-
Optional,
1615
TypeVar,
17-
Union,
1816
cast,
1917
overload,
2018
)

mypy/checkexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from collections import defaultdict
99
from collections.abc import Iterable, Iterator, Sequence
1010
from contextlib import contextmanager, nullcontext
11-
from typing import Callable, ClassVar, Final, Optional, cast, overload
11+
from typing import Callable, ClassVar, Final, cast, overload
1212
from typing_extensions import TypeAlias as _TypeAlias, assert_never
1313

1414
import mypy.checker

mypy/checkstrformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import re
1616
from re import Match, Pattern
17-
from typing import Callable, Final, Union, cast
17+
from typing import Callable, Final, cast
1818
from typing_extensions import TypeAlias as _TypeAlias
1919

2020
import mypy.errorcodes as codes

mypy/config_parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
import tomli as tomllib
1515

1616
from collections.abc import Mapping, MutableMapping, Sequence
17-
from typing import Any, Callable, Final, TextIO, Union
17+
from typing import Any, Callable, Final, TextIO
1818
from typing_extensions import Never, TypeAlias
1919

2020
from mypy import defaults
2121
from mypy.options import PER_MODULE_OPTIONS, Options
2222

23-
_CONFIG_VALUE_TYPES: TypeAlias = str | bool | int | float | dict[str, str] | list[str] | tuple[int, int]
23+
_CONFIG_VALUE_TYPES: TypeAlias = (
24+
str | bool | int | float | dict[str, str] | list[str] | tuple[int, int]
25+
)
2426
_INI_PARSER_CALLABLE: TypeAlias = Callable[[Any], _CONFIG_VALUE_TYPES]
2527

2628

mypy/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections import defaultdict
77
from collections.abc import Iterable, Iterator
88
from itertools import chain
9-
from typing import Callable, Final, NoReturn, Optional, TextIO, TypeVar
9+
from typing import Callable, Final, NoReturn, TextIO, TypeVar
1010
from typing_extensions import Literal, Self, TypeAlias as _TypeAlias
1111

1212
from mypy import errorcodes as codes

mypy/exportjson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import argparse
1717
import json
1818
import sys
19-
from typing import Any, Union
19+
from typing import Any
2020
from typing_extensions import TypeAlias as _TypeAlias
2121

2222
from librt.internal import ReadBuffer

mypy/fastparse.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import warnings
66
from collections.abc import Sequence
7-
from typing import Any, Callable, Final, Literal, Optional, TypeVar, Union, cast, overload
7+
from typing import Any, Callable, Final, Literal, TypeVar, Union, cast, overload
88

99
from mypy import defaults, errorcodes as codes, message_registry
1010
from mypy.errors import Errors
@@ -806,9 +806,7 @@ def _check_ifstmt_for_overloads(
806806
):
807807
return None
808808

809-
overload_name = cast(
810-
Decorator | FuncDef | OverloadedFuncDef, stmt.body[0].body[-1]
811-
).name
809+
overload_name = cast(Decorator | FuncDef | OverloadedFuncDef, stmt.body[0].body[-1]).name
812810
if stmt.else_body is None:
813811
return overload_name
814812

mypy/plugins/singledispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from collections.abc import Sequence
4-
from typing import NamedTuple, TypeVar, Union
4+
from typing import NamedTuple, TypeVar
55
from typing_extensions import TypeAlias as _TypeAlias
66

77
from mypy.messages import format_type

0 commit comments

Comments
 (0)