[Numpy-discussion] Is a string a scalar type?

Robert Kern robert.kern@gmail....
Sat Mar 24 19:56:33 CDT 2007

Charles R Harris wrote:
> In [10]: isscalar('hello world')
> Out[10]: True

I would say that, intrinsically, yes, strings are constructed as sequences of
other things. However, essentially every use case I have for *testing* whether
or not something is a sequence (or inversely, a scalar), I want strings to
answer as "not a sequence".

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list