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

Remove incorrect Collection base class and __contains__ method from QuerySet #1925

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions django-stubs/db/models/query.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class NamedValuesListIterable(ValuesListIterable[NamedTuple]):
class FlatValuesListIterable(BaseIterable[_Row]):
def __iter__(self) -> Iterator[_Row]: ...

class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized):
class _QuerySet(Generic[_T, _Row], Reversible[_Row], Iterable[_Row], Sized):
model: type[_T]
query: Query
_iterable_class: type[BaseIterable]
Expand Down Expand Up @@ -178,7 +178,6 @@ class _QuerySet(Generic[_T, _Row], Collection[_Row], Reversible[_Row], Sized):
def resolve_expression(self, *args: Any, **kwargs: Any) -> Any: ...
def __iter__(self) -> Iterator[_Row]: ...
def __aiter__(self) -> AsyncIterator[_Row]: ...
def __contains__(self, x: object) -> bool: ...
@overload
def __getitem__(self, i: int) -> _Row: ...
@overload
Expand Down
3 changes: 0 additions & 3 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ django.contrib.gis.db.models.Q.__init__
django.contrib.gis.db.models.Q.check
django.contrib.gis.db.models.Q.flatten
django.contrib.gis.db.models.Q.resolve_expression
django.contrib.gis.db.models.QuerySet.__contains__
django.contrib.gis.db.models.QuerySet.__deepcopy__
django.contrib.gis.db.models.QuerySet.__reversed__
django.contrib.gis.db.models.QuerySet.__xor__
Expand Down Expand Up @@ -1014,7 +1013,6 @@ django.db.models.Q.__init__
django.db.models.Q.check
django.db.models.Q.flatten
django.db.models.Q.resolve_expression
django.db.models.QuerySet.__contains__
django.db.models.QuerySet.__deepcopy__
django.db.models.QuerySet.__reversed__
django.db.models.QuerySet.__xor__
Expand Down Expand Up @@ -1408,7 +1406,6 @@ django.db.models.options.Options.local_concrete_fields
django.db.models.options.Options.many_to_many
django.db.models.options.Options.related_objects
django.db.models.query.EmptyQuerySet.__init__
django.db.models.query.QuerySet.__contains__
django.db.models.query.QuerySet.__deepcopy__
django.db.models.query.QuerySet.__reversed__
django.db.models.query.QuerySet.__xor__
Expand Down