[Python-ideas] discontinue iterable strings

Random832 random832 at fastmail.com
Sat Aug 20 02:01:17 EDT 2016


On Sat, Aug 20, 2016, at 01:47, Franklin? Lee wrote:
> That says, "This is a 0-length array of 3-char Unicode strings." Numpy
> doesn't recognize the string as a specification of an array. Try
> `np.array(4.)` and you'll get (IIRC) `array(4., dtype='float')`, which
> has
> shape `()`. Numpy probably won't let you index either one. What can you
> even do with it?

In my poking around I found that you can index it with [()] or access
with .item() and .itemset(value). Still seems more like a party trick
than the well-reasoned practical implementation choice he implied it
was.


More information about the Python-ideas mailing list