BUG: StringDType .str
property is confusing
#28670
Labels
Content-Length: 246652 | pFad | http://github.com/numpy/numpy/issues/28670
72.str
property is confusing
#28670
Fetched URL: http://github.com/numpy/numpy/issues/28670
Alternative Proxies:
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue:
The output of
str(np.dtypes.StringDType())
is'StringDType()'
.The output of
np.dtypes.StringDType().str
is'|T16'
.I think that the
.str
output is quite uninformative, and it would be much better as'StringDType()'
too.Namely, I don't think that the final user should be exposed to the word-size, which is not representative of the consumed memory, is an implementation detail, and (to my understanding) changes between 32 and 64 bit architectures.
Reproduce the code example:
Python and NumPy Versions:
NumPy 2.2.4
Context for the issue:
h5py/h5py#2557 (comment)
versioned_hdf5
, like many other wrappers around NumPy dtypes, needs to pretty-print metadata information in their__repr__
methods. We had to special-case around this.The text was updated successfully, but these errors were encountered: