[Numpy-discussion] Is a string a scalar?
Wed May 7 15:58:03 CDT 2008
On Wed, May 7, 2008 at 1:37 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Wed, May 7, 2008 at 3:24 PM, Keith Goodman <email@example.com> wrote:
> > >> np.isscalar('string')
> > True
> <shrug> Either option would cause someone to complain. It's not a
> cut-and-dry issue. However, since strings can be atomic elements
> through the various '|S<N>' dtypes, and we already have rules to
> special-case strings as atomic, "numpy.isscalar('string') == False"
> would be more inconsistent.
BTW, I noticed that defmatrix.py uses isscalar (from numeric import
isscalar) and N.isscalar (import numpric as N). Each is used only one
time. It confused me a little at first. But that's not saying much.
More information about the Numpy-discussion