File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1098,13 +1098,12 @@ cdef inline bint c_is_list_like(object obj, bint allow_sets) except -1:
1098
1098
# equiv: `isinstance(obj, abc.Iterable)`
1099
1099
getattr (obj, " __iter__" , None ) is not None and not isinstance (obj, type )
1100
1100
# we do not count strings/unicode/bytes as list-like
1101
- and not isinstance (obj, (str , bytes))
1101
+ # exclude Generic types that have __iter__
1102
+ and not isinstance (obj, (str , bytes, _GenericAlias))
1102
1103
# exclude zero-dimensional duck-arrays, effectively scalars
1103
1104
and not (hasattr (obj, " ndim" ) and obj.ndim == 0 )
1104
1105
# exclude sets if allow_sets is False
1105
1106
and not (allow_sets is False and isinstance (obj, abc.Set))
1106
- # exclude Generic types that have __iter__
1107
- and not isinstance (obj, _GenericAlias)
1108
1107
)
1109
1108
1110
1109
You can’t perform that action at this time.
0 commit comments