| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,6 +176,14 @@ bound into a function. | |||
| 176 | 176 | ||
| 177 | 177 | .. versionadded:: 3.12 | |
| 178 | 178 | ||
| 179 | + .. c:macro:: PY_FOREACH_CODE_EVENT(V) | ||
| 180 | + | ||
| 181 | + Apply the macro *V* to each suffix of :c:type:`PyCodeEvent` | ||
| 182 | + constants. | ||
| 183 | + Currently expands to ``V(CREATE) V(DESTROY)``. | ||
| 184 | + The macro *V* must accept one event name and supply any punctuation | ||
| 185 | + needed between expansions. | ||
| 186 | + | ||
| 179 | 187 | .. c:type:: int (*PyCode_WatchCallback)(PyCodeEvent event, PyCodeObject* co) | |
| 180 | 188 | ||
| 181 | 189 | Type of a code object watcher callback function. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -258,3 +258,23 @@ The argument must be a signed or unsigned :c:expr:`char`. | |||
| 258 | 258 | .. c:macro:: Py_TOUPPER(c) | |
| 259 | 259 | ||
| 260 | 260 | Return the uppercase equivalent of the character *c*. | |
| 261 | + | ||
| 262 | + | ||
| 263 | + Bit masks | ||
| 264 | + --------- | ||
| 265 | + | ||
| 266 | + The following constants are bit masks used by the character classification | ||
| 267 | + macros above: | ||
| 268 | + | ||
| 269 | + .. c:macro:: PY_CTF_ALNUM | ||
| 270 | + PY_CTF_ALPHA | ||
| 271 | + PY_CTF_DIGIT | ||
| 272 | + PY_CTF_LOWER | ||
| 273 | + PY_CTF_SPACE | ||
| 274 | + PY_CTF_UPPER | ||
| 275 | + PY_CTF_XDIGIT | ||
| 276 | + | ||
| 277 | + Values used internally by the ``Py_IS*`` classification macros above. | ||
| 278 | + Exposed for backwards compatibility only. | ||
| 279 | + | ||
| 280 | + .. soft-deprecated:: next | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -563,6 +563,15 @@ Dictionary objects | |||
| 563 | 563 | ||
| 564 | 564 | .. versionadded:: 3.12 | |
| 565 | 565 | ||
| 566 | + .. c:macro:: PY_FOREACH_DICT_EVENT(V) | ||
| 567 | + | ||
| 568 | + Apply the macro *V* to each suffix of :c:type:`PyDict_WatchEvent` | ||
| 569 | + constants. | ||
| 570 | + Currently expands to ``V(ADDED) V(MODIFIED) V(DELETED) V(CLONED) | ||
| 571 | + V(CLEARED) V(DEALLOCATED)``. | ||
| 572 | + The macro *V* must accept one event name and supply any punctuation | ||
| 573 | + needed between expansions. | ||
| 574 | + | ||
| 566 | 575 | .. c:type:: int (*PyDict_WatchCallback)(PyDict_WatchEvent event, PyObject *dict, PyObject *key, PyObject *new_value) | |
| 567 | 576 | ||
| 568 | 577 | Type of a dict watcher callback function. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -407,6 +407,11 @@ an error value). | |||
| 407 | 407 | documentation. There is no C API for warning control. | |
| 408 | 408 | ||
| 409 | 409 | ||
| 410 | + .. c:function:: int PyErr_Warn(PyObject *category, const char *message) | ||
| 411 | + | ||
| 412 | + Equivalent to :c:expr:`PyErr_WarnEx(category, message, 1)`. | ||
| 413 | + | ||
| 414 | + | ||
| 410 | 415 | .. c:function:: int PyErr_WarnExplicitObject(PyObject *category, PyObject *message, PyObject *filename, int lineno, PyObject *module, PyObject *registry) | |
| 411 | 416 | ||
| 412 | 417 | Issue a warning message with explicit control over all warning attributes. This | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,18 +162,30 @@ the :mod:`io` APIs instead. | |||
| 162 | 162 | Soft-deprecated API | |
| 163 | 163 | ^^^^^^^^^^^^^^^^^^^ | |
| 164 | 164 | ||
| 165 | - .. soft-deprecated:: 3.15 | ||
| 166 | - | ||
| 167 | 165 | These are APIs that were included in Python's C API | |
| 168 | 166 | by mistake. They are documented solely for completeness; use other | |
| 169 | 167 | ``PyFile*`` APIs instead. | |
| 170 | 168 | ||
| 169 | + | ||
| 171 | 170 | .. c:function:: PyObject *PyFile_NewStdPrinter(int fd) | |
| 172 | 171 | ||
| 173 | 172 | Use :c:func:`PyFile_FromFd` with defaults (``fd, NULL, "w", -1, NULL, NULL, NULL, 0``) instead. | |
| 174 | 173 | ||
| 174 | + .. soft-deprecated:: 3.15 | ||
| 175 | + | ||
| 176 | + | ||
| 175 | 177 | .. c:var:: PyTypeObject PyStdPrinter_Type | |
| 176 | 178 | ||
| 177 | 179 | Type of file-like objects used internally at Python startup when :py:mod:`io` is | |
| 178 | 180 | not yet available. | |
| 179 | 181 | Use Python :py:func:`open` or :c:func:`PyFile_FromFd` to create file objects instead. | |
| 182 | + | ||
| 183 | + .. soft-deprecated:: 3.15 | ||
| 184 | + | ||
| 185 | + | ||
| 186 | + .. c:macro:: PY_STDIOTEXTMODE | ||
| 187 | + | ||
| 188 | + The string literal ``"b"``, used to open files in binary mode. | ||
| 189 | + Exposed for backwards compatibility only. | ||
| 190 | + | ||
| 191 | + .. soft-deprecated:: next | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -188,6 +188,15 @@ There are a few functions specific to Python functions. | |||
| 188 | 188 | ||
| 189 | 189 | .. versionadded:: 3.15 | |
| 190 | 190 | ||
| 191 | + .. c:macro:: PY_FOREACH_FUNC_EVENT(V) | ||
| 192 | + | ||
| 193 | + Apply the macro *V* to each suffix of :c:type:`PyFunction_WatchEvent` | ||
| 194 | + constants. | ||
| 195 | + Currently expands to ``V(CREATE) V(DESTROY) V(MODIFY_CODE) | ||
| 196 | + V(MODIFY_DEFAULTS) V(MODIFY_KWDEFAULTS) V(MODIFY_QUALNAME)``. | ||
| 197 | + The macro *V* must accept one event name and supply any punctuation | ||
| 198 | + needed between expansions. | ||
| 199 | + | ||
| 191 | 200 | .. c:type:: int (*PyFunction_WatchCallback)(PyFunction_WatchEvent event, PyFunctionObject *func, PyObject *new_value) | |
| 192 | 201 | ||
| 193 | 202 | Type of a function watcher callback function. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,13 +32,19 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`. | |||
| 32 | 32 | .. c:macro:: Py_HASH_FNV | |
| 33 | 33 | Py_HASH_SIPHASH24 | |
| 34 | 34 | Py_HASH_SIPHASH13 | |
| 35 | + Py_HASH_EXTERNAL | ||
| 35 | 36 | ||
| 36 | 37 | Numerical values to compare to :c:macro:`Py_HASH_ALGORITHM` to determine | |
| 37 | - which algorithm is used for hashing. The hash algorithm can be configured | ||
| 38 | - via the configure :option:`--with-hash-algorithm` option. | ||
| 38 | + which algorithm is used for hashing. The built-in hash algorithm can be | ||
| 39 | + configured via the configure :option:`--with-hash-algorithm` option. | ||
| 40 | + | ||
| 41 | + :c:macro:`!Py_HASH_EXTERNAL` has value ``0`` and indicates a hash | ||
| 42 | + implementation supplied by the application embedding Python; see | ||
| 43 | + :c:var:`PyHash_Func`. | ||
| 39 | 44 | ||
| 40 | 45 | .. versionadded:: 3.4 | |
| 41 | - Add :c:macro:`!Py_HASH_FNV` and :c:macro:`!Py_HASH_SIPHASH24`. | ||
| 46 | + Add :c:macro:`!Py_HASH_FNV`, :c:macro:`!Py_HASH_SIPHASH24`, and | ||
| 47 | + :c:macro:`!Py_HASH_EXTERNAL`. | ||
| 42 | 48 | ||
| 43 | 49 | .. versionadded:: 3.11 | |
| 44 | 50 | Add :c:macro:`!Py_HASH_SIPHASH13`. | |
@@ -132,6 +138,19 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`. | |||
| 132 | 138 | .. versionadded:: 3.4 | |
| 133 | 139 | ||
| 134 | 140 | ||
| 141 | + .. c:var:: PyHash_FuncDef PyHash_Func | ||
| 142 | + | ||
| 143 | + When Python is built with :c:macro:`Py_HASH_ALGORITHM` set to | ||
| 144 | + :c:macro:`Py_HASH_EXTERNAL`, the application embedding Python must define | ||
| 145 | + this variable to supply a hash implementation instead of using one of | ||
| 146 | + Python's built-in hash algorithms. | ||
| 147 | + | ||
| 148 | + .. versionadded:: 3.4 | ||
| 149 | + | ||
| 150 | + .. deprecated-removed:: 3.15 3.19 | ||
| 151 | + Use one of the built-in hash algorithms instead. | ||
| 152 | + | ||
| 153 | + | ||
| 135 | 154 | .. c:function:: PyHash_FuncDef* PyHash_GetFuncDef(void) | |
| 136 | 155 | ||
| 137 | 156 | Get the hash function definition. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -924,13 +924,26 @@ use them. | |||
| 924 | 924 | C99 doesn't define such a thing directly (size_t is an unsigned integral type). | |
| 925 | 925 | See :pep:`353` for details. | |
| 926 | 926 | ||
| 927 | + | ||
| 928 | + .. c:macro:: Py_INVALID_SIZE | ||
| 929 | + | ||
| 930 | + A constant of type :c:type:`Py_ssize_t` with value ``-1``, representing an | ||
| 931 | + invalid size. | ||
| 932 | + | ||
| 933 | + | ||
| 927 | 934 | .. c:macro:: PY_SSIZE_T_MAX | |
| 928 | 935 | PY_SSIZE_T_MIN | |
| 929 | 936 | ||
| 930 | 937 | The limit values (largest positive one and smallest negative one, | |
| 931 | 938 | respecitvely) of type :c:type:`Py_ssize_t`. | |
| 932 | 939 | ||
| 933 | 940 | ||
| 941 | + .. c:macro:: PY_DWORD_MAX | ||
| 942 | + | ||
| 943 | + The maximum value of the Windows ``DWORD`` type. | ||
| 944 | + Expands to ``0xffffffff`` on all platforms. | ||
| 945 | + | ||
| 946 | + | ||
| 934 | 947 | .. _api-exceptions: | |
| 935 | 948 | ||
| 936 | 949 | Exceptions | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -680,6 +680,21 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. | |||
| 680 | 680 | .. versionadded:: 3.12 | |
| 681 | 681 | ||
| 682 | 682 | ||
| 683 | + Build configuration | ||
| 684 | + ^^^^^^^^^^^^^^^^^^^ | ||
| 685 | + | ||
| 686 | + .. c:macro:: PYLONG_BITS_IN_DIGIT | ||
| 687 | + | ||
| 688 | + The number of bits in each digit of CPython's native representation of | ||
| 689 | + integers. | ||
| 690 | + The value can currently be either ``30`` (the default) or ``15``, | ||
| 691 | + selected with :option:`--enable-big-digits` when building Python. | ||
| 692 | + | ||
| 693 | + To access the native representation of integers, use | ||
| 694 | + :c:func:`PyLong_GetNativeLayout` and its | ||
| 695 | + :c:member:`~PyLongLayout.bits_per_digit` member instead. | ||
| 696 | + | ||
| 697 | + | ||
| 683 | 698 | Export API | |
| 684 | 699 | ^^^^^^^^^^ | |
| 685 | 700 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -170,28 +170,56 @@ would typically correspond to a Python function. | |||
| 170 | 170 | .. The table is here to make the docs searchable, and to allow automatic | |
| 171 | 171 | links to the identifiers. | |
| 172 | 172 | ||
| 173 | - ================================================== ===================================== | ||
| 174 | - Macro Event | ||
| 175 | - ================================================== ===================================== | ||
| 176 | - .. c:macro:: PY_MONITORING_EVENT_BRANCH_LEFT :monitoring-event:`BRANCH_LEFT` | ||
| 177 | - .. c:macro:: PY_MONITORING_EVENT_BRANCH_RIGHT :monitoring-event:`BRANCH_RIGHT` | ||
| 178 | - .. c:macro:: PY_MONITORING_EVENT_CALL :monitoring-event:`CALL` | ||
| 179 | - .. c:macro:: PY_MONITORING_EVENT_C_RAISE :monitoring-event:`C_RAISE` | ||
| 180 | - .. c:macro:: PY_MONITORING_EVENT_C_RETURN :monitoring-event:`C_RETURN` | ||
| 181 | - .. c:macro:: PY_MONITORING_EVENT_EXCEPTION_HANDLED :monitoring-event:`EXCEPTION_HANDLED` | ||
| 182 | - .. c:macro:: PY_MONITORING_EVENT_INSTRUCTION :monitoring-event:`INSTRUCTION` | ||
| 183 | - .. c:macro:: PY_MONITORING_EVENT_JUMP :monitoring-event:`JUMP` | ||
| 184 | - .. c:macro:: PY_MONITORING_EVENT_LINE :monitoring-event:`LINE` | ||
| 185 | - .. c:macro:: PY_MONITORING_EVENT_PY_RESUME :monitoring-event:`PY_RESUME` | ||
| 186 | - .. c:macro:: PY_MONITORING_EVENT_PY_RETURN :monitoring-event:`PY_RETURN` | ||
| 187 | - .. c:macro:: PY_MONITORING_EVENT_PY_START :monitoring-event:`PY_START` | ||
| 188 | - .. c:macro:: PY_MONITORING_EVENT_PY_THROW :monitoring-event:`PY_THROW` | ||
| 189 | - .. c:macro:: PY_MONITORING_EVENT_PY_UNWIND :monitoring-event:`PY_UNWIND` | ||
| 190 | - .. c:macro:: PY_MONITORING_EVENT_PY_YIELD :monitoring-event:`PY_YIELD` | ||
| 191 | - .. c:macro:: PY_MONITORING_EVENT_RAISE :monitoring-event:`RAISE` | ||
| 192 | - .. c:macro:: PY_MONITORING_EVENT_RERAISE :monitoring-event:`RERAISE` | ||
| 193 | - .. c:macro:: PY_MONITORING_EVENT_STOP_ITERATION :monitoring-event:`STOP_ITERATION` | ||
| 194 | - ================================================== ===================================== | ||
| 173 | + .. list-table:: | ||
| 174 | + :header-rows: 1 | ||
| 175 | + :widths: 50 37 | ||
| 176 | + | ||
| 177 | + * - Macro | ||
| 178 | + - Event | ||
| 179 | + * - .. c:macro:: PY_MONITORING_EVENT_BRANCH_LEFT | ||
| 180 | + - :monitoring-event:`BRANCH_LEFT` | ||
| 181 | + * - .. c:macro:: PY_MONITORING_EVENT_BRANCH_RIGHT | ||
| 182 | + - :monitoring-event:`BRANCH_RIGHT` | ||
| 183 | + * - .. c:macro:: PY_MONITORING_EVENT_CALL | ||
| 184 | + - :monitoring-event:`CALL` | ||
| 185 | + * - .. c:macro:: PY_MONITORING_EVENT_C_RAISE | ||
| 186 | + - :monitoring-event:`C_RAISE` | ||
| 187 | + * - .. c:macro:: PY_MONITORING_EVENT_C_RETURN | ||
| 188 | + - :monitoring-event:`C_RETURN` | ||
| 189 | + * - .. c:macro:: PY_MONITORING_EVENT_EXCEPTION_HANDLED | ||
| 190 | + - :monitoring-event:`EXCEPTION_HANDLED` | ||
| 191 | + * - .. c:macro:: PY_MONITORING_EVENT_INSTRUCTION | ||
| 192 | + - :monitoring-event:`INSTRUCTION` | ||
| 193 | + * - .. c:macro:: PY_MONITORING_EVENT_JUMP | ||
| 194 | + - :monitoring-event:`JUMP` | ||
| 195 | + * - .. c:macro:: PY_MONITORING_EVENT_LINE | ||
| 196 | + - :monitoring-event:`LINE` | ||
| 197 | + * - .. c:macro:: PY_MONITORING_EVENT_PY_RESUME | ||
| 198 | + - :monitoring-event:`PY_RESUME` | ||
| 199 | + * - .. c:macro:: PY_MONITORING_EVENT_PY_RETURN | ||
| 200 | + - :monitoring-event:`PY_RETURN` | ||
| 201 | + * - .. c:macro:: PY_MONITORING_EVENT_PY_START | ||
| 202 | + - :monitoring-event:`PY_START` | ||
| 203 | + * - .. c:macro:: PY_MONITORING_EVENT_PY_THROW | ||
| 204 | + - :monitoring-event:`PY_THROW` | ||
| 205 | + * - .. c:macro:: PY_MONITORING_EVENT_PY_UNWIND | ||
| 206 | + - :monitoring-event:`PY_UNWIND` | ||
| 207 | + * - .. c:macro:: PY_MONITORING_EVENT_PY_YIELD | ||
| 208 | + - :monitoring-event:`PY_YIELD` | ||
| 209 | + * - .. c:macro:: PY_MONITORING_EVENT_RAISE | ||
| 210 | + - :monitoring-event:`RAISE` | ||
| 211 | + * - .. c:macro:: PY_MONITORING_EVENT_RERAISE | ||
| 212 | + - :monitoring-event:`RERAISE` | ||
| 213 | + * - .. c:macro:: PY_MONITORING_EVENT_STOP_ITERATION | ||
| 214 | + - :monitoring-event:`STOP_ITERATION` | ||
| 215 | + * - .. c:macro:: PY_MONITORING_EVENT_BRANCH | ||
| 216 | + | ||
| 217 | + .. deprecated:: 3.14 | ||
| 218 | + Use :c:macro:`PY_MONITORING_EVENT_BRANCH_LEFT` | ||
| 219 | + and :c:macro:`PY_MONITORING_EVENT_BRANCH_RIGHT` instead. | ||
| 220 | + | ||
| 221 | + - :monitoring-event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` | ||
| 222 | + | ||
| 195 | 223 | ||
| 196 | 224 | .. c:function:: int PyMonitoring_ExitScope(void) | |
| 197 | 225 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments