FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-141004: Document Py_ARRAY_LENGTH macro by Yashp002 · Pull Request #141598 · python/cpython · GitHub

/ cpython Public
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) .rst  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 12 additions & 0 deletions Doc/c-api/intro.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,18 @@ complete listing.
PyDoc_VAR(python_doc) = PyDoc_STR("A genus of constricting snakes in the Pythonidae family native "
"to the tropics and subtropics of the Eastern Hemisphere.");

.. c:macro:: Py_ARRAY_LENGTH(array)

Compute the length (number of elements) of a statically allocated C array at
compile time.

The *array* argument must be a C array with a size known at compile time,
not a pointer. Using this macro with a pointer will produce incorrect results.

This is generally equivalent to::

sizeof(array) / sizeof((array)[0])


.. _api-objects:

Expand Down
2 changes: 2 additions & 0 deletions Doc/c-api/structures.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,8 @@ Macro name C type Python type

Always ``None``. Must be used with :c:macro:`Py_READONLY`.



Comment on lines +733 to +734

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change

Unrelated changes.

Defining Getters and Setters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion Misc/mypy/_colorize.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion Misc/mypy/token.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Loading

Back | FazBrowse Home | New Git URL