summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
authorAllan Haldane <ealloc@gmail.com>2017-11-13 23:49:48 +0100
committerGitHub <noreply@github.com>2017-11-13 23:49:48 +0100
commit565e8ca9ab7009160f99e7925402057684642b09 (patch)
tree542a4c2b2ba06d9a138aa1158c77e00c9c35ad4e /numpy/ma/core.py
parente06ec341dbcd752d0f9b263ad45553c82d8b32ac (diff)
parentdf0fff45adbd3f291632b23c0cbd256bbbe912bb (diff)
downloadnumpy-565e8ca9ab7009160f99e7925402057684642b09.tar.gz
Merge pull request #9201 from eric-wieser/ndarray-unicode
BUG: Fix unicode(unicode_array_0d) on python 2.7
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index b71e8fa06..0d02bb315 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3867,6 +3867,10 @@ class MaskedArray(ndarray):
def __str__(self):
return str(self._insert_masked_print())
+ if sys.version_info.major < 3:
+ def __unicode__(self):
+ return unicode(self._insert_masked_print())
+
def __repr__(self):
"""
Literal string representation.
@@ -6238,6 +6242,10 @@ class MaskedConstant(MaskedArray):
def __str__(self):
return str(masked_print_option._display)
+ if sys.version_info.major < 3:
+ def __unicode__(self):
+ return unicode(masked_print_option._display)
+
def __repr__(self):
if self is MaskedConstant.__singleton:
return 'masked'