@@ -52,9 +52,9 @@ with the new scheme to use the ``np`` prefix consistently:
52
52
The NEP does not propose to change how these scalars print – only
53
53
their representation (``__repr__ ``) will be changed.
54
54
Further, array representation will not be affected since it already
55
- includes the ``dtype= `` when necessary.
55
+ includes the ``dtype= `` when necessary.
56
56
57
- The main motivation behind the change is that the Python numerical types
57
+ The main motivation behind the change is that the Python numerical types
58
58
behave differently from the NumPy scalars.
59
59
For example numbers with lower precision (e.g. ``uint8 `` or ``float16 ``)
60
60
should be used with care and users should be aware when they are working
@@ -136,7 +136,7 @@ This NEP proposes to change the represenatation for NumPy scalars to:
136
136
``np.longdouble('3.0') ``. This ensures that it can always roundtrip correctly
137
137
and matches ``decimal.Decimal ``.
138
138
Further, for these two the size based name such as ``float128 `` will not
139
- be adopted, as it is platform dependend and imprecise.
139
+ be adopted, as it is platform dependend and imprecise.
140
140
* ``np.str_("string") `` and ``np.bytes_(b"byte_string") `` for string dtypes.
141
141
142
142
Where booleans are printed as their singletons since this is more concise.
@@ -164,6 +164,24 @@ to always print as ``longdouble`` and never ``float128`` or ``float96``.
164
164
It does not include deprecating the ``np.float128 `` alias.
165
165
However, such a deprecation may occur independently of the NEP.
166
166
167
+ Integer scalar type name and instance represenatation
168
+ -----------------------------------------------------
169
+
170
+ One detail is that due to NumPy scalar types being based on the C types,
171
+ NumPy sometimes distinguishes them, for example on most 64 bit systems
172
+ (not windows)::
173
+
174
+ >>> np.longlong
175
+ numpy.longlong
176
+ >>> np.longlong(3)
177
+ np.int64(3)
178
+
179
+ The proposal will lead to the ``longlong `` name for the type while
180
+ using the ``int64 `` form for the scalar.
181
+ This choice is made since ``int64 `` is generally the more useful
182
+ information for users, but the type name itself must be precise.
183
+
184
+
167
185
Related Work
168
186
============
169
187
0 commit comments