Skip to content

Commit 0338954

Browse files
committed
BUG: Fix RecursionError when apply native generic alias as a func (pandas-dev#61565)
1 parent 7d542b4 commit 0338954

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/_libs/lib.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ from collections import abc
22
from decimal import Decimal
33
from enum import Enum
44
from sys import getsizeof
5+
from types import GenericAlias
56
from typing import (
67
Literal,
78
_GenericAlias,
@@ -1298,7 +1299,7 @@ cdef bint c_is_list_like(object obj, bint allow_sets) except -1:
12981299
getattr(obj, "__iter__", None) is not None and not isinstance(obj, type)
12991300
# we do not count strings/unicode/bytes as list-like
13001301
# exclude Generic types that have __iter__
1301-
and not isinstance(obj, (str, bytes, _GenericAlias))
1302+
and not isinstance(obj, (str, bytes, _GenericAlias, GenericAlias))
13021303
# exclude zero-dimensional duck-arrays, effectively scalars
13031304
and not (hasattr(obj, "ndim") and obj.ndim == 0)
13041305
# exclude sets if allow_sets is False

0 commit comments

Comments
 (0)