Skip to content

Commit 34ce3a6

Browse files
Revert collections import (#798)
1 parent 437f2c4 commit 34ce3a6

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Python
2727
uses: actions/setup-python@v4
2828
with:
29-
python-version: 3.x
29+
python-version: 3.8
3030
- name: Cache PyPI
3131
uses: actions/cache@v3
3232
with:

CHANGES/798.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a type annotations regression introduced in v6.0.2 under Python versions <3.10. It was caused by importing certain types only available in newer versions.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ black-check:
4242
mypy:
4343
mypy
4444

45-
lint: flake8 black-check mypy isort-check check_changes
45+
lint: mypy flake8 black-check isort-check check_changes
4646

4747
fmt:
4848
black -t py35 $(SRC)

multidict/__init__.pyi

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import abc
2-
from collections.abc import Iterable, Iterator, Mapping, MutableMapping
3-
from typing import Generic, TypeAlias, TypeVar, overload
2+
from typing import (
3+
Generic,
4+
Iterable,
5+
Iterator,
6+
Mapping,
7+
MutableMapping,
8+
TypeVar,
9+
overload,
10+
)
411

512
class istr(str): ...
613

714
upstr = istr
815

9-
_S: TypeAlias = str | istr
16+
_S = str | istr
1017

1118
_T = TypeVar("_T")
1219

@@ -28,9 +35,9 @@ class MultiMapping(Mapping[_S, _T_co]):
2835
@abc.abstractmethod
2936
def getone(self, key: _S, default: _D) -> _T_co | _D: ...
3037

31-
_Arg: TypeAlias = (Mapping[str, _T] | Mapping[istr, _T] | dict[str, _T]
32-
| dict[istr, _T] | MultiMapping[_T]
33-
| Iterable[tuple[str, _T]] | Iterable[tuple[istr, _T]])
38+
_Arg = (Mapping[str, _T] | Mapping[istr, _T] | dict[str, _T]
39+
| dict[istr, _T] | MultiMapping[_T]
40+
| Iterable[tuple[str, _T]] | Iterable[tuple[istr, _T]])
3441

3542
class MutableMultiMapping(MultiMapping[_T], MutableMapping[_S, _T], Generic[_T]):
3643
@abc.abstractmethod

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ long_description = file: README.rst
88

99

1010
[flake8]
11-
ignore = E302,E701,E305,E704,F811,N811, W503
11+
# Y026,Y027: Incompatible with Python 3.7 (https://github.com/aio-libs/multidict/pull/798)
12+
ignore = E302,E701,E305,E704,F811,N811,W503,Y026,Y027
1213
max-line-length=88
1314

1415

0 commit comments

Comments
 (0)