File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments