Skip to content

Commit 8a9fc39

Browse files
Address my own comments.
1 parent f27366a commit 8a9fc39

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Doc/c-api/intro.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,15 @@ complete listing.
324324

325325
.. c:macro:: Py_ARRAY_LENGTH(array)
326326
327-
Compute the length (number of elements) of a statically allocated C array at
328-
compile time.
327+
Compute the length of a statically allocated C array at compile time.
329328

330329
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.
330+
not on the heap. Passing a heap-allocated array will result in a compilation
331+
error on some compilers, or otherwise produce incorrect results.
332+
333+
This is roughly equivalent to::
334+
335+
sizeof(array) / sizeof((array)[0])
333336

334337

335338
.. _api-objects:

0 commit comments

Comments
 (0)