Skip to content

Commit 54af68c

Browse files
authored
Add a few # noqas to unblock PyCQA/flake8-pyi#213 (#7658)
1 parent 073f9f4 commit 54af68c

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

stdlib/_collections_abc.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from types import MappingProxyType
3-
from typing import (
3+
from typing import ( # noqa: Y027
44
AbstractSet as Set,
55
AsyncGenerator as AsyncGenerator,
66
AsyncIterable as AsyncIterable,

stdlib/array.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import sys
22
from _typeshed import Self
33
from collections.abc import Iterable
4-
from typing import Any, BinaryIO, Generic, MutableSequence, TypeVar, overload
4+
5+
# pytype crashes if array inherits from collections.abc.MutableSequence instead of typing.MutableSequence
6+
from typing import Any, BinaryIO, Generic, MutableSequence, TypeVar, overload # noqa: Y027
57
from typing_extensions import Literal, SupportsIndex, TypeAlias
68

79
_IntTypeCode: TypeAlias = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]

stdlib/builtins.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ from collections.abc import (
3636
)
3737
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
3838
from types import CodeType, TracebackType, _Cell
39-
from typing import (
39+
40+
# mypy crashes if any of {ByteString, Sequence, MutableSequence} are imported from collections.abc in builtins.pyi
41+
from typing import ( # noqa: Y027
4042
IO,
4143
Any,
4244
BinaryIO,

stdlib/types.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ from collections.abc import (
1515
)
1616
from importlib.abc import _LoaderProtocol
1717
from importlib.machinery import ModuleSpec
18-
from typing import Any, ClassVar, Generic, Mapping, TypeVar, overload
18+
19+
# pytype crashes if types.MappingProxyType inherits from collections.abc.Mapping instead of typing.Mapping
20+
from typing import Any, ClassVar, Generic, Mapping, TypeVar, overload # noqa: Y027
1921
from typing_extensions import Literal, ParamSpec, final
2022

2123
if sys.version_info >= (3, 10):

0 commit comments

Comments
 (0)