Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert collections import #798

Merged
merged 12 commits into from Dec 24, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x
Dreamsorcerer marked this conversation as resolved.
Show resolved Hide resolved
python-version: 3.8
- name: Cache PyPI
uses: actions/cache@v3
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGES/798.bugfix
@@ -0,0 +1 @@
Fix a regression from 6.0.2 in type annotations when using Python <3.10.
Dreamsorcerer marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -42,7 +42,7 @@ black-check:
mypy:
mypy

lint: flake8 black-check mypy isort-check check_changes
lint: mypy flake8 black-check isort-check check_changes

fmt:
black -t py35 $(SRC)
Expand Down
19 changes: 13 additions & 6 deletions multidict/__init__.pyi
@@ -1,12 +1,19 @@
import abc
from collections.abc import Iterable, Iterator, Mapping, MutableMapping
from typing import Generic, TypeAlias, TypeVar, overload
from typing import (
Generic,
Iterable,
Iterator,
Mapping,
MutableMapping,
TypeVar,
overload,
)

class istr(str): ...

upstr = istr

_S: TypeAlias = str | istr
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
_S = str | istr

_T = TypeVar("_T")

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

_Arg: TypeAlias = (Mapping[str, _T] | Mapping[istr, _T] | dict[str, _T]
| dict[istr, _T] | MultiMapping[_T]
| Iterable[tuple[str, _T]] | Iterable[tuple[istr, _T]])
_Arg = (Mapping[str, _T] | Mapping[istr, _T] | dict[str, _T]
| dict[istr, _T] | MultiMapping[_T]
| Iterable[tuple[str, _T]] | Iterable[tuple[istr, _T]])

class MutableMultiMapping(MultiMapping[_T], MutableMapping[_S, _T], Generic[_T]):
@abc.abstractmethod
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -8,7 +8,7 @@ long_description = file: README.rst


[flake8]
ignore = E302,E701,E305,E704,F811,N811, W503
ignore = E302,E701,E305,E704,F811,N811,W503,Y026,Y027
Dreamsorcerer marked this conversation as resolved.
Show resolved Hide resolved
max-line-length=88


Expand Down