Spaces:
Running on Zero
A newer version of the Gradio SDK is available: 6.20.0
API and ABI Versioning {#apiabiversion}
Build-time version constants
CPython exposes its version number in the following macros. Note that these correspond to the version code is built with. See Py_Version{.interpreted-text role="c:var"} for the version used at run time.
See stable{.interpreted-text role="ref"} for a discussion of API and ABI stability across versions.
The
3in3.4.1a2.
The
4in3.4.1a2.
The
1in3.4.1a2.
The
ain3.4.1a2. This can be0xAfor alpha,0xBfor beta,0xCfor release candidate or0xFfor final.For completeness, the values are available as macros:
!PY_RELEASE_LEVEL_ALPHA{.interpreted-text role="c:macro"} (0xA),!PY_RELEASE_LEVEL_BETA{.interpreted-text role="c:macro"} (0xB),!PY_RELEASE_LEVEL_GAMMA{.interpreted-text role="c:macro"} (0xC), and!PY_RELEASE_LEVEL_FINAL{.interpreted-text role="c:macro"} (0xF).
The
2in3.4.1a2. Zero for final releases.
The Python version number encoded in a single integer. See
Py_PACK_FULL_VERSION{.interpreted-text role="c:func"} for the encoding details.Use this for numeric comparisons, for example,
#if PY_VERSION_HEX >= ....
The Python version as a string, for example,
"3.4.1a2".
These macros are defined in Include/patchlevel.h{.interpreted-text role="source"}.
Run-time version
The Python runtime version number encoded in a single constant integer. See
Py_PACK_FULL_VERSION{.interpreted-text role="c:func"} for the encoding details. This contains the Python version used at run time.Use this for numeric comparisons, for example,
if (Py_Version >= ...).::: versionadded 3.11 :::
Bit-packing macros
Return the given version, encoded as a single 32-bit integer with the following structure:
+------------------+-------------+--------------+-----------+-------------------------+ | Argument | No. of bits | Bit mask | Bit shift | Example values | | | | | +------------+------------+ | | | | |
3.4.1a2|3.10.0| +==================+=============+==============+===========+============+============+ | major | > 8 |0xFF000000| 24 |0x03|0x03| +------------------+-------------+--------------+-----------+------------+------------+ | minor | > 8 |0x00FF0000| 16 |0x04|0x0A| +------------------+-------------+--------------+-----------+------------+------------+ | micro | > 8 |0x0000FF00| 8 |0x01|0x00| +------------------+-------------+--------------+-----------+------------+------------+ | release_level | > 4 |0x000000F0| 4 |0xA|0xF| +------------------+-------------+--------------+-----------+------------+------------+ | release_serial | > 4 |0x0000000F| 0 |0x2|0x0| +------------------+-------------+--------------+-----------+------------+------------+For example:
Version
Py_PACK_FULL_VERSIONarguments Encoded version
3.4.1a2(3, 4, 1, 0xA, 2)0x030401a2
3.10.0(3, 10, 0, 0xF, 0)0x030a00f0Out-of range bits in the arguments are ignored. That is, the macro can be defined as:
#ifndef Py_PACK_FULL_VERSION #define Py_PACK_FULL_VERSION(X, Y, Z, LEVEL, SERIAL) ( \ (((X) & 0xff) << 24) | \ (((Y) & 0xff) << 16) | \ (((Z) & 0xff) << 8) | \ (((LEVEL) & 0xf) << 4) | \ (((SERIAL) & 0xf) << 0)) #endif
Py_PACK_FULL_VERSIONis primarily a macro, intended for use in#ifdirectives, but it is also available as an exported function.::: versionadded 3.14 :::
Equivalent to
Py_PACK_FULL_VERSION(major, minor, 0, 0, 0). The result does not correspond to any Python release, but is useful in numeric comparisons.::: versionadded 3.14 :::