def _isnumpy(obj):
    '''Return True for a NumPy arange, array, matrix, etc. instance.
    '''
    if _numpy_types:  # see also _len_numpy
        return isinstance(obj, _numpy_types) or \
             (_moduleof(_classof(obj)).startswith('numpy') and
               hasattr(obj, 'nbytes'))
    return False
Return True for a NumPy arange, array, matrix, etc. instance.
    
recipes/Python/546530_Size_of_Python_objects_revised/recipe-546530.py