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
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.7
- name: Cache PyPI
uses: actions/cache@v3
with:
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