ENH: Create string dtype instances from the abstract dtype#22923
ENH: Create string dtype instances from the abstract dtype#22923seberg merged 5 commits intonumpy:mainfrom
Conversation
34a9624 to
c7d7984
Compare
seberg
left a comment
There was a problem hiding this comment.
Thanks, a few comments, but generally I am happy with adding this.
Documenting this seems awkward (even the release note...) until we have a clear spelling for type(np.dtype('U')).
After that, it seems pretty obvious to document it in the class.
c7d7984 to
43626f2
Compare
43626f2 to
64395b4
Compare
|
Thanks for the comments! I used |
seberg
left a comment
There was a problem hiding this comment.
Happy, although that swap would be nice (adding a test would also be nice maybe, since 2**30 hits it).
I will assume nobody minds this tiny API addition, so planning to merge soon.
| } | ||
|
|
||
| if (size < 0) { | ||
| PyErr_Format(PyExc_ValueError, |
There was a problem hiding this comment.
Changed this to value error, because I thought even the other ones make more sense that way. But then, it shares the error with other paths, so only did this one.
If anyone doesn't like, happy to follow up. Will merge once tests are done, thanks Nathan.
Following up from #22863 (comment), this makes it possible to create string dtype instances from an abstract string
DTypeMeta.Should I support any additional arguments or keywords to
__new__besidessize? Possiblybyteorder?Should this be documented somewhere? If so, where?