Skip to content

Commit 735e84c

Browse files
authored
Fix __iter__ not returning iterator (#159)
1 parent fc3e1d9 commit 735e84c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rest_framework-stubs/utils/serializer_helpers.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections import OrderedDict
2-
from typing import Any, Dict, Iterable, List, MutableMapping, Tuple, Union
2+
from typing import Any, Dict, Iterator, List, MutableMapping, Tuple, Union
33

44
from rest_framework.exceptions import ErrorDetail
55
from rest_framework.fields import Field
@@ -33,7 +33,7 @@ class BoundField:
3333
class JSONBoundField(BoundField): ...
3434

3535
class NestedBoundField(BoundField):
36-
def __iter__(self) -> Iterable[str]: ...
36+
def __iter__(self) -> Iterator[str]: ...
3737
def __getitem__(self, key: str) -> Union[BoundField, NestedBoundField]: ...
3838

3939
class BindingDict(MutableMapping[str, Field]):
@@ -43,5 +43,5 @@ class BindingDict(MutableMapping[str, Field]):
4343
def __setitem__(self, key: str, field: Field) -> None: ...
4444
def __getitem__(self, key: str) -> Field: ...
4545
def __delitem__(self, key: str) -> None: ...
46-
def __iter__(self) -> Iterable[Field]: ... # type: ignore[override]
46+
def __iter__(self) -> Iterator[Field]: ... # type: ignore[override]
4747
def __len__(self) -> int: ...

0 commit comments

Comments
 (0)