-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG/OFMT: fix repring of python3 bytes objects #4456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1613,7 +1613,8 @@ def _is_sequence(x): | |||
try: | |||
iter(x) | |||
len(x) # it has a length | |||
return not isinstance(x, compat.string_types) and True | |||
return not isinstance(x, compat.string_types + | |||
(compat.binary_type,)) and True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jreback is this True
here for a reason? It will have no effect on the return value of _is_sequence
...
@jreback ok 2 merge? |
return not isinstance(x, compat.string_types) and True | ||
except Exception: | ||
len(x) # it has a length | ||
return not isinstance(x, compat.string_types + (compat.binary_type,)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would define something like compat.string_and_binary_types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw - that only matters for python3 - bytes is str in py2
On Aug 3, 2013 1:47 PM, "Phillip Cloud" notifications@github.com wrote:
In pandas/core/common.py:
@@ -1612,9 +1612,9 @@ def is_list_like(arg):
def _is_sequence(x):
try:
iter(x)
len(x) # it has a length
return not isinstance(x, compat.string_types) and True
- except Exception:
len(x) # it has a length
return not isinstance(x, compat.string_types + (compat.binary_type,))
ok
—
Reply to this email directly or view it on GitHubhttps://github.com//pull/4456/files#r5567493
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but that's issue here...
think this is good 2 go now |
ok |
BUG/OFMT: fix repring of python3 bytes objects
closes #4455.