@@ -37,9 +37,8 @@ of the flexible itemsize array types (:class:`str_`,
37
37
38
38
**Figure: ** Hierarchy of type objects representing the array data
39
39
types. Not shown are the two integer types :class: `intp` and
40
- :class: `uintp` which just point to the integer type that holds a
41
- pointer for the platform. All the number types can be obtained
42
- using bit-width names as well.
40
+ :class: `uintp` which are used for indexing (the same as the
41
+ default integer since NumPy 2).
43
42
44
43
45
44
.. TODO - use something like this instead of the diagram above, as it generates
@@ -377,21 +376,29 @@ are also provided.
377
376
378
377
Alias for the signed integer type (one of `numpy.byte `, `numpy.short `,
379
378
`numpy.intc `, `numpy.int_ `, `numpy.long ` and `numpy.longlong `)
380
- that is the same size as a pointer .
379
+ that is used as a default integer and for indexing .
381
380
382
- Compatible with the C ``intptr_t ``.
381
+ Compatible with the C ``Py_ssize_t ``.
383
382
384
- :Character code: ``'p' ``
383
+ :Character code: ``'n' ``
384
+
385
+ .. versionchanged :: 2.0
386
+ Before NumPy 2, this had the same size as a pointer. In practice this
387
+ is almost always identical, but the character code ``'p' `` maps to the C
388
+ ``intptr_t ``. The character code ``'n' `` was added in NumPy 2.0.
385
389
386
390
.. attribute :: uintp
387
391
388
- Alias for the unsigned integer type (one of ` numpy.ubyte `, ` numpy.ushort `,
389
- ` numpy.uintc `, ` numpy.uint `, ` numpy.ulong ` and ` numpy.ulonglong `)
390
- that is the same size as a pointer .
392
+ Alias for the unsigned integer type that is the same size as `` intp ``.
393
+
394
+ Compatible with the C `` size_t `` .
391
395
392
- Compatible with the C `` uintptr_t ``.
396
+ :Character code: `` 'N' ``
393
397
394
- :Character code: ``'P' ``
398
+ .. versionchanged :: 2.0
399
+ Before NumPy 2, this had the same size as a pointer. In practice this
400
+ is almost always identical, but the character code ``'P' `` maps to the C
401
+ ``uintptr_t ``. The character code ``'N' `` was added in NumPy 2.0.
395
402
396
403
.. autoclass :: numpy.float16
397
404
0 commit comments