We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f27366a commit 8a9fc39Copy full SHA for 8a9fc39
1 file changed
Doc/c-api/intro.rst
@@ -324,12 +324,15 @@ complete listing.
324
325
.. c:macro:: Py_ARRAY_LENGTH(array)
326
327
- Compute the length (number of elements) of a statically allocated C array at
328
- compile time.
+ Compute the length of a statically allocated C array at compile time.
329
330
The *array* argument must be a C array with a size known at compile time,
331
- not a pointer. On supported compilers, passing a pointer will result in a
332
- compilation error or otherwise produce incorrect results.
+ not on the heap. Passing a heap-allocated array will result in a compilation
+ error on some compilers, or otherwise produce incorrect results.
+
333
+ This is roughly equivalent to::
334
335
+ sizeof(array) / sizeof((array)[0])
336
337
338
.. _api-objects:
0 commit comments