Skip to content

Commit

Permalink
Merge from 2.3: Fix for issue #2783
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Nov 16, 2015
2 parents 22d7c71 + 2ed3e1c commit 7d47d92
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spyderlib/widgets/variableexplorer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ class FakeObject(object):
# Numpy arrays support
#==============================================================================
try:
from numpy import ndarray
from numpy import array, matrix #@UnusedImport (object eval)
from numpy import ndarray, array, matrix, recarray
from numpy.ma import MaskedArray
from numpy import savetxt as np_savetxt
except ImportError:
ndarray = array = matrix = MaskedArray = np_savetxt = FakeObject # analysis:ignore
ndarray = array = matrix = recarray = MaskedArray = np_savetxt = FakeObject # analysis:ignore


def get_numpy_dtype(obj):
Expand Down Expand Up @@ -233,6 +232,9 @@ def unsorted_unique(lista):
#==============================================================================
def value_to_display(value, truncate=False, trunc_len=80, minmax=False):
"""Convert value for display purpose"""
if isinstance(value, recarray):
fields = value.names
return 'Field names: ' + ', '.join(fields)
if minmax and isinstance(value, (ndarray, MaskedArray)):
if value.size == 0:
return repr(value)
Expand Down

0 comments on commit 7d47d92

Please sign in to comment.