[Numpy-discussion] dtype '|S0' not understood

David Warde-Farley dwf@cs.toronto....
Thu Sep 24 19:03:27 CDT 2009

On 23-Sep-09, at 7:55 PM, David Warde-Farley wrote:

> It seems that either dtype(str) should do something more sensible than
> zero-length string, or it should be possible to create it with  
> dtype('|
> S0').  Which should it be?

Since there wasn't any response I went ahead and fixed it by making  
str and unicode dtypes allow a size of 0 when constructed with  
protocol type codes. Either S0 and U0 should be constructable with  
typecodes or they shouldn't be allowed at all; I opted for the latter  
since a) it was simple and b) I don't know what a sensible default for  
dtype(str) would be (length 1? length 10?).

Patch is at:


Review away!


More information about the NumPy-Discussion mailing list