Skip to content

Commit 38c0821

Browse files
committed
Merge remote-tracking branch 'upstream/master' into 3.8-typing-extensions
2 parents 7ef1d9e + 9e40be6 commit 38c0821

File tree

13 files changed

+31
-35
lines changed

13 files changed

+31
-35
lines changed

misc/upload-pypi.py

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

2828

2929
def is_whl_or_tar(name: str) -> bool:
30-
return name.endswith(".tar.gz") or name.endswith(".whl")
30+
return name.endswith((".tar.gz", ".whl"))
3131

3232

3333
def item_ok_for_pypi(name: str) -> bool:

mypy/build.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@
2525
import sys
2626
import time
2727
import types
28-
from collections.abc import Iterator, Mapping, Sequence
28+
from collections.abc import Iterator, Mapping, Sequence, Set as AbstractSet
2929
from typing import (
3030
TYPE_CHECKING,
31-
AbstractSet,
3231
Any,
3332
Callable,
3433
ClassVar,

mypy/checker.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,9 @@
44

55
import itertools
66
from collections import defaultdict
7-
from collections.abc import Iterable, Iterator, Mapping, Sequence
7+
from collections.abc import Iterable, Iterator, Mapping, Sequence, Set as AbstractSet
88
from contextlib import ExitStack, contextmanager
9-
from typing import (
10-
AbstractSet,
11-
Callable,
12-
Final,
13-
Generic,
14-
NamedTuple,
15-
Optional,
16-
TypeVar,
17-
Union,
18-
cast,
19-
overload,
20-
)
9+
from typing import Callable, Final, Generic, NamedTuple, Optional, TypeVar, Union, cast, overload
2110
from typing_extensions import TypeAlias as _TypeAlias
2211

2312
import mypy.checkexpr

mypy/dmypy_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import sys
1717
import time
1818
import traceback
19-
from collections.abc import Sequence
19+
from collections.abc import Sequence, Set as AbstractSet
2020
from contextlib import redirect_stderr, redirect_stdout
21-
from typing import AbstractSet, Any, Callable, Final
21+
from typing import Any, Callable, Final
2222
from typing_extensions import TypeAlias as _TypeAlias
2323

2424
import mypy.build

mypy/fswatcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from __future__ import annotations
44

55
import os
6-
from collections.abc import Iterable
7-
from typing import AbstractSet, NamedTuple
6+
from collections.abc import Iterable, Set as AbstractSet
7+
from typing import NamedTuple
88

99
from mypy.fscache import FileSystemCache
1010

mypy/graph_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from __future__ import annotations
44

5-
from collections.abc import Iterable, Iterator
6-
from typing import AbstractSet, TypeVar
5+
from collections.abc import Iterable, Iterator, Set as AbstractSet
6+
from typing import TypeVar
77

88
T = TypeVar("T")
99

mypy/semanal_shared.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def require_bool_literal_argument(
452452
api: SemanticAnalyzerInterface | SemanticAnalyzerPluginInterface,
453453
expression: Expression,
454454
name: str,
455-
default: Literal[True] | Literal[False],
455+
default: Literal[True, False],
456456
) -> bool: ...
457457

458458

mypy/stubgenc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def _from_sigs(cls, sigs: list[FunctionSig], is_abstract: bool = False) -> CFunc
203203
sigs[0].name, "\n".join(sig.format_sig()[:-4] for sig in sigs), is_abstract
204204
)
205205

206-
def __get__(self) -> None:
206+
def __get__(self) -> None: # noqa: PLE0302
207207
"""
208208
This exists to make this object look like a method descriptor and thus
209209
return true for CStubGenerator.ismethod()

mypy/stubtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
import typing_extensions
2626
import warnings
2727
from collections import defaultdict
28-
from collections.abc import Iterator
28+
from collections.abc import Iterator, Set as AbstractSet
2929
from contextlib import redirect_stderr, redirect_stdout
3030
from functools import singledispatch
3131
from pathlib import Path
32-
from typing import AbstractSet, Any, Final, Generic, TypeVar, Union
32+
from typing import Any, Final, Generic, TypeVar, Union
3333
from typing_extensions import get_origin, is_typeddict
3434

3535
import mypy.build

mypy/test/testgraph.py

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

55
import sys
6-
from typing import AbstractSet
6+
from collections.abc import Set as AbstractSet
77

88
from mypy.build import BuildManager, BuildSourceSet, State, order_ascc, sorted_components
99
from mypy.errors import Errors

0 commit comments

Comments
 (0)