mypy m2m iterator fix (#655)

* feat: add type hint for items in iterators for m2m relations

* chore: make flake8 happy
- rename some variables
- reorder some imports

* switch to typing.List

Co-authored-by: Benjamin Mollier <benjamin.mollier@meetap.de>
Co-authored-by: collerek <collerek@gmail.com>
This commit is contained in:
Boemjay
2022-07-22 15:24:24 +02:00
committed by GitHub
parent 991d4a2a2c
commit 54305c25d1
5 changed files with 7 additions and 8 deletions

View File

@ -86,6 +86,7 @@ async def test_types() -> None:
# reveal_type(publisher) # model method
# reveal_type(publishers) # many to many
# reveal_type(publishers[0]) # item in m2m list
# reveal_type(next(p for p in publishers)) # item in m2m iterator
# # getting relation without __getattribute__
# reveal_type(authors) # reverse many to many # TODO: wrong
# reveal_type(book2) # queryset get