Skip to content

Commit 0862f02

Browse files
committed
ENH/CLN: add string and binary types compat object
1 parent 76299b5 commit 0862f02

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pandas/compat/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ def u(s):
185185
def u(s):
186186
return unicode(s, "unicode_escape")
187187

188+
189+
string_and_binary_types = string_types + (binary_type,)
190+
191+
188192
try:
189193
# callable reintroduced in later versions of Python
190194
callable = callable

pandas/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ def _is_sequence(x):
16131613
try:
16141614
iter(x)
16151615
len(x) # it has a length
1616-
return not isinstance(x, compat.string_types + (compat.binary_type,))
1616+
return not isinstance(x, compat.string_and_binary_types)
16171617
except (TypeError, AttributeError):
16181618
return False
16191619

0 commit comments

Comments
 (0)