forked from mirror/Archipelago
also exclude bytes in is_iterable_but_str
This commit is contained in:
4
Utils.py
4
Utils.py
@@ -970,7 +970,7 @@ class RepeatableChain:
|
||||
|
||||
|
||||
def is_iterable_but_str(obj: object) -> TypeGuard[typing.Iterable[typing.Any]]:
|
||||
""" but not a `str` (because technically, `str` is `Iterable[str]`) """
|
||||
if isinstance(obj, str):
|
||||
""" but not a `str` nor `bytes` (because technically, `str` and `bytes` are `Iterable[str | bytes]`) """
|
||||
if isinstance(obj, (str, bytes)):
|
||||
return False
|
||||
return isinstance(obj, typing.Iterable)
|
||||
|
||||
Reference in New Issue
Block a user