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

Type django.utils.* against Django 4.2 #1575

Merged
merged 21 commits into from
Jun 26, 2023
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: remove legacy Self import from _typeshed
GabDug committed Jun 26, 2023

Verified

This commit was signed with the committer’s verified signature.
booc0mtaco Holloway
commit 79a405572c849ab06e53d0f68f8c6950e14d2546
10 changes: 5 additions & 5 deletions django-stubs/utils/datastructures.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from collections.abc import Collection, Iterable, Iterator, Mapping, MutableMapping, MutableSet
from typing import Any, Generic, NoReturn, Protocol, Tuple, TypeVar, overload # noqa: Y022

from _typeshed import Incomplete, Self
from typing_extensions import TypeAlias
from _typeshed import Incomplete
from typing_extensions import Self, TypeAlias

_K = TypeVar("_K")
_V = TypeVar("_V")
@@ -39,7 +39,7 @@ class _IndexableCollection(Protocol[_I], Collection[_I]):
@overload
def __getitem__(self, index: int) -> _I: ...
@overload
def __getitem__(self: Self, index: slice) -> Self: ...
def __getitem__(self, index: slice) -> Self: ...

class OrderedSet(MutableSet[_K]):
dict: dict[_K, None]
@@ -75,7 +75,7 @@ class MultiValueDict(dict[_K, _V]):
def items(self) -> Iterator[tuple[_K, _V | list[object]]]: ... # type: ignore
def lists(self) -> Iterable[tuple[_K, list[_V]]]: ...
def dict(self) -> dict[_K, _V | list[object]]: ...
def copy(self: Self) -> Self: ...
def copy(self) -> Self: ...
def __getitem__(self, key: _K) -> _V | list[object]: ... # type: ignore
def __setitem__(self, key: _K, value: _V) -> None: ...
# These overrides are needed to convince mypy that this isn't an abstract class
@@ -89,7 +89,7 @@ class MultiValueDict(dict[_K, _V]):

class ImmutableList(tuple[_V, ...]):
warning: str
def __new__(cls: type[Self], *args: Any, warning: str = ..., **kwargs: Any) -> Self: ...
def __new__(cls, *args: Any, warning: str = ..., **kwargs: Any) -> Self: ...
def complain(self, *args: Any, **kwargs: Any) -> NoReturn: ...

class _ItemCallable(Protocol[_V]):