On Fri, Feb 14, 2014 at 4:51 PM, Charles G. Waldman <char...@crunch.io>wrote:
> >>> d = numpy.dtype(int) > >>> if d: print "OK" > ... else: print "I'm surprised" > > I'm surprised > _______________________________________________ > I think this is an artifact of regular dtypes having "length" of zero: >>> len(array(1.).dtype) 0 For record arrays dtypes you would get True: >>> len(numpy.dtype([('x', int)])) 1 >>> bool(numpy.dtype([('x', int)])) True
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion