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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user