We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38f9ee5 commit cf087d2Copy full SHA for cf087d2
Utils.py
@@ -970,7 +970,7 @@ def __len__(self):
970
971
972
def is_iterable_but_str(obj: object) -> TypeGuard[typing.Iterable[typing.Any]]:
973
- """ but not a `str` (because technically, `str` is `Iterable[str]`) """
974
- if isinstance(obj, str):
+ """ but not a `str` nor `bytes` (because technically, `str` and `bytes` are `Iterable[str | bytes]`) """
+ if isinstance(obj, (str, bytes)):
975
return False
976
return isinstance(obj, typing.Iterable)
0 commit comments