From 2dadd681ffeda03ee252ff0cb105f22b0a2cce55 Mon Sep 17 00:00:00 2001 From: Seth Yastrov Date: Fri, 22 Feb 2019 20:02:33 +0100 Subject: [PATCH] Change in_bulk id_list param to Iterable rather than Sequence. --- django-stubs/db/models/query.pyi | 2 +- scripts/typecheck_tests.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/django-stubs/db/models/query.pyi b/django-stubs/db/models/query.pyi index de51553..34e82cb 100644 --- a/django-stubs/db/models/query.pyi +++ b/django-stubs/db/models/query.pyi @@ -84,7 +84,7 @@ class QuerySet(Iterable[_T], Sized): def latest(self, *fields: Any, field_name: Optional[Any] = ...) -> _T: ... def first(self) -> Optional[_T]: ... def last(self) -> Optional[_T]: ... - def in_bulk(self, id_list: Sequence[Any] = ..., *, field_name: str = ...) -> Dict[Any, _T]: ... + def in_bulk(self, id_list: Iterable[Any] = ..., *, field_name: str = ...) -> Dict[Any, _T]: ... def delete(self) -> Tuple[int, Dict[str, int]]: ... def update(self, **kwargs: Any) -> int: ... def _update(self, values: Any) -> Optional[Any]: ... diff --git a/scripts/typecheck_tests.py b/scripts/typecheck_tests.py index fa68a6a..3d822f9 100644 --- a/scripts/typecheck_tests.py +++ b/scripts/typecheck_tests.py @@ -214,6 +214,10 @@ IGNORED_ERRORS = { 'logging_tests': [ re.compile('"(setUpClass|tearDownClass)" undefined in superclass') ], + 'lookup': [ + 'Unexpected keyword argument "headline__startswith" for "in_bulk" of "QuerySet"', + 'note: ' + ], 'many_to_one': [ 'Incompatible type for "parent" of "Child" (got "None", expected "Union[Parent, Combinable]")' ],