Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
This issue is similar to#7795 ("is_numlike should be deprecated and replaced by the correct isinstance calls"):cbook.is_string_like
returns True for 0-dimensional masked arrays of string dtype (but not regular arrays...), but testing foris_string_like
is often followed by calling of string methods (.lower()
, etc.) on the object, or passing the object to, say,open()
-- neither of which work with masked arrays of string dtype. (check yourself withgit grep -A2 'is_string_like('
)
In other words the actual semantics of the function simply do not match how it is used.
Most of these calls should probably be replaced byisinstance(obj, six.string_types)
(possiblyisinstance(obj, (six.string_types, six.binary_type))
depending on the case), which is much more explicit.