Expand description
Raw FFI declarations for Python’s C API.
PyO3 can be used to write native Python modules or run Python code and modules from Rust.
This crate just provides low level bindings to the Python interpreter. It is meant for advanced users only - regular PyO3 users shouldn’t need to interact with this crate at all.
The contents of this crate are not documented here, as it would entail basically copying the documentation from CPython. Consult the Python/C API Reference Manual for up-to-date documentation.
§Safety
The functions in this crate lack individual safety documentation, but generally the following apply:
- Pointer arguments have to point to a valid Python object of the correct type, although null pointers are sometimes valid input.
- The vast majority can only be used safely while the GIL is held.
- Some functions have additional safety requirements, consult the Python/C API Reference Manual for more information.
§Feature flags
PyO3 uses feature flags to enable you to opt-in to additional functionality. For a detailed description, see the Features chapter of the guide.
§Optional feature flags
The following features customize PyO3’s behavior:
abi3
: Restricts PyO3’s API to a subset of the full Python API which is guaranteed by PEP 384 to be forward-compatible with future Python versions.extension-module
: This will tell the linker to keep the Python symbols unresolved, so that your module can also be used with statically linked Python interpreters. Use this feature when building an extension module.
§rustc
environment flags
PyO3 uses rustc
’s --cfg
flags to enable or disable code used for different Python versions.
If you want to do this for your own crate, you can do so with the pyo3-build-config
crate.
Py_3_7
,Py_3_8
,Py_3_9
,Py_3_10
,Py_3_11
,Py_3_12
,Py_3_13
: Marks code that is only enabled when compiling for a given minimum Python version.Py_LIMITED_API
: Marks code enabled when theabi3
feature flag is enabled.Py_GIL_DISABLED
: Marks code that runs only in the free-threaded build of CPython.PyPy
- Marks code enabled when compiling for PyPy.GraalPy
- Marks code enabled when compiling for GraalPy.
Additionally, you can query for the values Py_DEBUG
, Py_REF_DEBUG
,
Py_TRACE_REFS
, and COUNT_ALLOCS
from py_sys_config
to query for the
corresponding C build-time defines. For example, to conditionally define
debug code using Py_DEBUG
, you could do:
#[cfg(py_sys_config = "Py_DEBUG")]
println!("only runs if python was compiled with Py_DEBUG")
To use these attributes, add pyo3-build-config
as a build dependency in
your Cargo.toml
:
[build-dependencies]
pyo3-build-config ="0.23.2"
And then either create a new build.rs
file in the project root or modify
the existing build.rs
file to call use_pyo3_cfgs()
:
fn main() {
pyo3_build_config::use_pyo3_cfgs();
}
§Minimum supported Rust and Python versions
pyo3-ffi
supports the following Python distributions:
- CPython 3.7 or greater
- PyPy 7.3 (Python 3.9+)
- GraalPy 24.0 or greater (Python 3.10+)
§Example: Building Python Native modules
PyO3 can be used to generate a native Python module. The easiest way to try this out for the
first time is to use maturin
. maturin
is a tool for building and publishing Rust-based
Python packages with minimal configuration. The following steps set up some files for an example
Python module, install maturin
, and then show how to build and import the Python module.
First, create a new folder (let’s call it string_sum
) containing the following two files:
Cargo.toml
[lib]
name = "string_sum"
# "cdylib" is necessary to produce a shared library for Python to import from.
#
# Downstream Rust code (including code in `bin/`, `examples/`, and `tests/`) will not be able
# to `use string_sum;` unless the "rlib" or "lib" crate type is also included, e.g.:
# crate-type = ["cdylib", "rlib"]
crate-type = ["cdylib"]
[dependencies.pyo3-ffi]
version = "0.23.2"
features = ["extension-module"]
[build-dependencies]
# This is only necessary if you need to configure your build based on
# the Python version or the compile-time configuration for the interpreter.
pyo3_build_config = "0.23.2"
If you need to use conditional compilation based on Python version or how
Python was compiled, you need to add pyo3-build-config
as a
build-dependency
in your Cargo.toml
as in the example above and either
create a new build.rs
file or modify an existing one so that
pyo3_build_config::use_pyo3_cfgs()
gets called at build time:
build.rs
fn main() {
pyo3_build_config::use_pyo3_cfgs()
}
src/lib.rs
use std::os::raw::{c_char, c_long};
use std::ptr;
use pyo3_ffi::*;
static mut MODULE_DEF: PyModuleDef = PyModuleDef {
m_base: PyModuleDef_HEAD_INIT,
m_name: c_str!("string_sum").as_ptr(),
m_doc: c_str!("A Python module written in Rust.").as_ptr(),
m_size: 0,
m_methods: unsafe { METHODS as *const [PyMethodDef] as *mut PyMethodDef },
m_slots: std::ptr::null_mut(),
m_traverse: None,
m_clear: None,
m_free: None,
};
static mut METHODS: &[PyMethodDef] = &[
PyMethodDef {
ml_name: c_str!("sum_as_string").as_ptr(),
ml_meth: PyMethodDefPointer {
PyCFunctionFast: sum_as_string,
},
ml_flags: METH_FASTCALL,
ml_doc: c_str!("returns the sum of two integers as a string").as_ptr(),
},
// A zeroed PyMethodDef to mark the end of the array.
PyMethodDef::zeroed(),
];
// The module initialization function, which must be named `PyInit_<your_module>`.
#[allow(non_snake_case)]
#[no_mangle]
pub unsafe extern "C" fn PyInit_string_sum() -> *mut PyObject {
let module = PyModule_Create(ptr::addr_of_mut!(MODULE_DEF));
if module.is_null() {
return module;
}
#[cfg(Py_GIL_DISABLED)]
{
if PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED) < 0 {
Py_DECREF(module);
return std::ptr::null_mut();
}
}
module
}
/// A helper to parse function arguments
/// If we used PyO3's proc macros they'd handle all of this boilerplate for us :)
unsafe fn parse_arg_as_i32(obj: *mut PyObject, n_arg: usize) -> Option<i32> {
if PyLong_Check(obj) == 0 {
let msg = format!(
"sum_as_string expected an int for positional argument {}\0",
n_arg
);
PyErr_SetString(PyExc_TypeError, msg.as_ptr().cast::<c_char>());
return None;
}
// Let's keep the behaviour consistent on platforms where `c_long` is bigger than 32 bits.
// In particular, it is an i32 on Windows but i64 on most Linux systems
let mut overflow = 0;
let i_long: c_long = PyLong_AsLongAndOverflow(obj, &mut overflow);
#[allow(irrefutable_let_patterns)] // some platforms have c_long equal to i32
if overflow != 0 {
raise_overflowerror(obj);
None
} else if let Ok(i) = i_long.try_into() {
Some(i)
} else {
raise_overflowerror(obj);
None
}
}
unsafe fn raise_overflowerror(obj: *mut PyObject) {
let obj_repr = PyObject_Str(obj);
if !obj_repr.is_null() {
let mut size = 0;
let p = PyUnicode_AsUTF8AndSize(obj_repr, &mut size);
if !p.is_null() {
let s = std::str::from_utf8_unchecked(std::slice::from_raw_parts(
p.cast::<u8>(),
size as usize,
));
let msg = format!("cannot fit {} in 32 bits\0", s);
PyErr_SetString(PyExc_OverflowError, msg.as_ptr().cast::<c_char>());
}
Py_DECREF(obj_repr);
}
}
pub unsafe extern "C" fn sum_as_string(
_self: *mut PyObject,
args: *mut *mut PyObject,
nargs: Py_ssize_t,
) -> *mut PyObject {
if nargs != 2 {
PyErr_SetString(
PyExc_TypeError,
c_str!("sum_as_string expected 2 positional arguments").as_ptr(),
);
return std::ptr::null_mut();
}
let (first, second) = (*args, *args.add(1));
let first = match parse_arg_as_i32(first, 1) {
Some(x) => x,
None => return std::ptr::null_mut(),
};
let second = match parse_arg_as_i32(second, 2) {
Some(x) => x,
None => return std::ptr::null_mut(),
};
match first.checked_add(second) {
Some(sum) => {
let string = sum.to_string();
PyUnicode_FromStringAndSize(string.as_ptr().cast::<c_char>(), string.len() as isize)
}
None => {
PyErr_SetString(
PyExc_OverflowError,
c_str!("arguments too large to add").as_ptr(),
);
std::ptr::null_mut()
}
}
}
With those two files in place, now maturin
needs to be installed. This can be done using
Python’s package manager pip
. First, load up a new Python virtualenv
, and install maturin
into it:
$ cd string_sum
$ python -m venv .env
$ source .env/bin/activate
$ pip install maturin
Now build and execute the module:
$ maturin develop
# lots of progress output as maturin runs the compilation...
$ python
>>> import string_sum
>>> string_sum.sum_as_string(5, 20)
'25'
As well as with maturin
, it is possible to build using setuptools-rust or
manually. Both offer more flexibility than maturin
but require further
configuration.
This example stores the module definition statically and uses the PyModule_Create
function
in the CPython C API to register the module. This is the “old” style for registering modules
and has the limitation that it cannot support subinterpreters. You can also create a module
using the new multi-phase initialization API that does support subinterpreters. See the
sequential
project located in the examples
directory at the root of the pyo3-ffi
crate
for a worked example of how to this using pyo3-ffi
.
§Using Python from Rust
To embed Python into a Rust binary, you need to ensure that your Python installation contains a shared library. The following steps demonstrate how to ensure this (for Ubuntu).
To install the Python shared library on Ubuntu:
sudo apt install python3-dev
While most projects use the safe wrapper provided by pyo3,
you can take a look at the orjson
library as an example on how to use pyo3-ffi
directly.
For those well versed in C and Rust the tutorials from the CPython documentation
can be easily converted to rust as well.
Re-exports§
pub use crate::_PyWeakReference as PyWeakReference;
Non- PyPy
and non-Py_LIMITED_API
and non-GraalPy
pub use self::marshal::*;
Non- Py_LIMITED_API
Modules§
- C API Compatibility Shims
- marshal
Non- Py_LIMITED_API
- structmember
Deprecated
Macros§
- This is a helper macro to create a
&'static CStr
.
Structs§
- PyASCII
Object Non- Py_LIMITED_API
- PyAsync
Methods Non- Py_LIMITED_API
- PyBase
Exception Object Non- Py_LIMITED_API
- PyBuffer
Procs Non- Py_LIMITED_API
- PyByte
Array Object Neither PyPy
norGraalPy
norPy_LIMITED_API
- PyBytes
Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
norPy_LIMITED_API
- PyCFunction
Object Py_3_9
and non-Py_LIMITED_API
and non-GraalPy
- PyCMethod
Object Py_3_9
and non-PyPy
and non-Py_LIMITED_API
and non-GraalPy
- PyCode
Object Neither PyPy
norGraalPy
andPy_3_8
and non-Py_3_11
and non-Py_LIMITED_API
- PyCompact
Unicode Object Non- Py_LIMITED_API
- PyCompiler
Flags Non- Py_LIMITED_API
- PyComplex
Object Non- Py_LIMITED_API
- PyConfig
Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyDate
Time_ CAPI Non- Py_LIMITED_API
- PyDate
Time_ Date Non- Py_LIMITED_API
Structure representing adatetime.date
- PyDate
Time_ Date Time Non- Py_LIMITED_API
Structure representing adatetime.datetime
. - PyDate
Time_ Delta Non- Py_LIMITED_API
Structure representing adatetime.timedelta
. - PyDate
Time_ Time Non- Py_LIMITED_API
Structure representing adatetime.time
. - PyDescr
Object Non- Py_LIMITED_API
- PyDict
Keys Object Non- PyPy
and non-Py_LIMITED_API
- PyDict
Object Non- PyPy
and non-Py_LIMITED_API
and non-GraalPy
- PyFloat
Object Non- Py_LIMITED_API
- PyFrame
Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
norPy_3_11
- PyFunction
Object Neither PyPy
norGraalPy
andPy_3_10
and non-Py_LIMITED_API
- PyFuture
Features Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
norPy_3_13
- PyGen
Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- Represents the PyGetSetDef structure.
- PyGet
SetDescr Object Non- Py_LIMITED_API
- PyHash_
Func Def Neither Py_LIMITED_API
norPyPy
norGraalPy
- PyHeap
Type Object Non- Py_LIMITED_API
- PyImport
Error Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyList
Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyMapping
Methods Non- Py_LIMITED_API
- PyMem
Allocator Ex Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- Represents the PyMemberDef structure.
- PyMember
Descr Object Non- Py_LIMITED_API
- Represents the PyMethodDef structure.
- PyMethod
Descr Object Non- Py_LIMITED_API
- PyNumber
Methods Non- Py_LIMITED_API
- PyOS
Error Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyObject
Arena Allocator Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyPre
Config Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PySequence
Methods Non- Py_LIMITED_API
- PySet
Object Neither Py_LIMITED_API
norPyPy
norGraalPy
- PySlice
Object Non- Py_LIMITED_API
- PyStatus
Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStop
Iteration Object Non- Py_LIMITED_API
- PySyntax
Error Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PySystem
Exit Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyTry
Block Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
norPy_3_11
- PyTuple
Object Non- Py_LIMITED_API
- PyType
Object Non- Py_LIMITED_API
- PyUnicode
Error Object Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyUnicode
Object Non- Py_LIMITED_API
- PyWide
String List Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyWrapper
Descr Object Non- Py_LIMITED_API
- Py_
buffer Non- Py_3_11
and non-Py_LIMITED_API
- Py_
complex Non- Py_LIMITED_API
- _PyDate
Time_ Base Date Time Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Structure representing adatetime.datetime
without atzinfo
member. - _PyDate
Time_ Base Time Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Structure representing adatetime.time
without atzinfo
member. - _PyErr_
Stack Item Non- Py_LIMITED_API
and non-PyPy
- _PyOpcache
Non- Py_LIMITED_API
- _PyWeak
Reference Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- _frozen
Non- Py_LIMITED_API
and non-PyPy
- _inittab
Non- Py_LIMITED_API
and non-PyPy
- setentry
Neither Py_LIMITED_API
norPyPy
norGraalPy
- wrapperbase
Non- Py_LIMITED_API
Enums§
- PyMem
Allocator Domain Non- Py_LIMITED_API
- PySend
Result Py_3_10
- _PyStatus_
TYPE Py_3_8
and non-PyPy
and non-Py_LIMITED_API
Constants§
- CO_
ASYNC_ GENERATOR Non- Py_LIMITED_API
- CO_
COROUTINE Non- Py_LIMITED_API
- CO_
FUTURE_ ABSOLUTE_ IMPORT Non- Py_LIMITED_API
- CO_
FUTURE_ BARRY_ AS_ BDFL Non- Py_LIMITED_API
- CO_
FUTURE_ DIVISION Non- Py_LIMITED_API
- CO_
FUTURE_ GENERATOR_ STOP Non- Py_LIMITED_API
- CO_
FUTURE_ PRINT_ FUNCTION Non- Py_LIMITED_API
- CO_
FUTURE_ UNICODE_ LITERALS Non- Py_LIMITED_API
- CO_
FUTURE_ WITH_ STATEMENT Non- Py_LIMITED_API
- CO_
GENERATOR Non- Py_LIMITED_API
- CO_
ITERABLE_ COROUTINE Non- Py_LIMITED_API
- CO_
MAXBLOCKS Non- Py_LIMITED_API
- CO_
NESTED Non- Py_LIMITED_API
- CO_
NEWLOCALS Non- Py_LIMITED_API
- CO_
NOFREE Non- Py_LIMITED_API
- CO_
OPTIMIZED Non- Py_LIMITED_API
- CO_
VARARGS Non- Py_LIMITED_API
- CO_
VARKEYWORDS Non- Py_LIMITED_API
- FUTURE_
ABSOLUTE_ IMPORT Non- Py_LIMITED_API
- FUTURE_
BARRY_ AS_ BDFL Non- Py_LIMITED_API
- FUTURE_
DIVISION Non- Py_LIMITED_API
- FUTURE_
GENERATORS Non- Py_LIMITED_API
- FUTURE_
GENERATOR_ STOP Non- Py_LIMITED_API
- FUTURE_
NESTED_ SCOPES Non- Py_LIMITED_API
- FUTURE_
PRINT_ FUNCTION Non- Py_LIMITED_API
- FUTURE_
UNICODE_ LITERALS Non- Py_LIMITED_API
- FUTURE_
WITH_ STATEMENT Non- Py_LIMITED_API
- METH_
FASTCALL Py_3_10
or non-Py_LIMITED_API
- METH_
METHOD Py_3_9
and non-Py_LIMITED_API
- PY_
BIG_ ENDIAN Little-endian - PY_
ITERSEARCH_ CONTAINS Non- Py_LIMITED_API
- PY_
ITERSEARCH_ COUNT Non- Py_LIMITED_API
- PY_
ITERSEARCH_ INDEX Non- Py_LIMITED_API
- PY_
LITTLE_ ENDIAN Little-endian - PY_
VECTORCALL_ ARGUMENTS_ OFFSET Non- Py_LIMITED_API
andPy_3_8
- PyBUF_
ANY_ CONTIGUOUS Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
CONTIG Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
CONTIG_ RO Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
C_ CONTIGUOUS Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
FORMAT Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
FULL Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
FULL_ RO Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
F_ CONTIGUOUS Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
INDIRECT Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
MAX_ NDIM Non- Py_3_11
and non-Py_LIMITED_API
Maximum number of dimensions - PyBUF_
ND Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
READ Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
RECORDS Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
RECORDS_ RO Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
SIMPLE Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
STRIDED Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
STRIDED_ RO Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
STRIDES Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
WRITABLE Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
WRITE Non- Py_3_11
and non-Py_LIMITED_API
- PyBUF_
WRITEABLE Non- Py_3_11
and non-Py_LIMITED_API
- PyDate
Time_ CAPSULE_ NAME Non- Py_LIMITED_API
- PyTrace_
CALL Non- Py_LIMITED_API
- PyTrace_
C_ CALL Non- Py_LIMITED_API
- PyTrace_
C_ EXCEPTION Non- Py_LIMITED_API
- PyTrace_
C_ RETURN Non- Py_LIMITED_API
- PyTrace_
EXCEPTION Non- Py_LIMITED_API
- PyTrace_
LINE Non- Py_LIMITED_API
- PyTrace_
OPCODE Non- Py_LIMITED_API
- PyTrace_
RETURN Non- Py_LIMITED_API
- PyUnicode_
1BYTE_ KIND Non- Py_LIMITED_API
- PyUnicode_
2BYTE_ KIND Non- Py_LIMITED_API
- PyUnicode_
4BYTE_ KIND Non- Py_LIMITED_API
- PyUnicode_
WCHAR_ KIND Deprecated Non- Py_LIMITED_API
and non-Py_3_12
- PyWrapper
Flag_ KEYWORDS Non- Py_LIMITED_API
- Py_
AUDIT_ READ Py_3_10
- Set if the type allows subclassing
- Objects support garbage collection (see objimp.h)
- Py_
TPFLAGS_ HAVE_ VECTORCALL Py_3_12
, orPy_3_8
and non-Py_LIMITED_API
Set if the type implements the vectorcall protocol (PEP 590) - Set if the type object is dynamically allocated
- Py_
TPFLAGS_ IMMUTABLETYPE Py_3_10
- Py_
TPFLAGS_ MAPPING Py_3_10
and non-Py_LIMITED_API
- Set if the type is ‘ready’ – fully initialized
- Set while the type is being ‘readied’, to prevent recursive ready calls
- Py_
TPFLAGS_ SEQUENCE Py_3_10
and non-Py_LIMITED_API
- Py_
fstring_ input Py_3_9
- Py_
func_ type_ input Py_3_8
- SSTATE_
INTERNED_ IMMORTAL Non- Py_LIMITED_API
- SSTATE_
INTERNED_ MORTAL Non- Py_LIMITED_API
- SSTATE_
NOT_ INTERNED Non- Py_LIMITED_API
- _Py_
T_ NONE Deprecated - _Py_
T_ OBJECT Deprecated - _Py_
WRITE_ RESTRICTED Deprecated
Statics§
- PyAsync
Gen_ ⚠Type Non- Py_LIMITED_API
- built-in ‘object’
- PyCMethod_
Type ⚠Py_3_9
and non-PyPy
and non-Py_LIMITED_API
- PyCode_
Type ⚠Neither PyPy
norGraalPy
and non-Py_LIMITED_API
- PyContext
Token_ ⚠Type Py_3_8
and non-Py_LIMITED_API
- PyContext
Var_ ⚠Type Py_3_8
and non-Py_LIMITED_API
- PyContext_
Type ⚠Py_3_8
and non-Py_LIMITED_API
- PyCoro_
Type ⚠Non- Py_LIMITED_API
- PyDict
RevIter ⚠Item_ Type Py_3_8
- PyDict
RevIter ⚠Key_ Type Py_3_8
- PyDict
RevIter ⚠Value_ Type Py_3_8
- PyExc_
Encoding ⚠Warning Py_3_10
- PyFrame_
Type ⚠Non- Py_LIMITED_API
- PyFunction_
Type ⚠Non- Py_LIMITED_API
and not (PyPy
and non-Py_3_8
) - PyGen_
Type ⚠Non- Py_LIMITED_API
- PyImport_
Frozen ⚠Modules Non- Py_LIMITED_API
and non-PyPy
- PyImport_
Inittab ⚠Non- Py_LIMITED_API
and non-PyPy
- built-in ‘super’
- built-in ‘type’
- Py_
Bytes ⚠Warning Flag Deprecated Non- Py_LIMITED_API
- Py_
Debug ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
Dont ⚠Write Bytecode Flag Deprecated Non- Py_LIMITED_API
- Py_
File ⚠System Default Encode Errors Deprecated - Py_
File ⚠System Default Encoding Deprecated - Py_
Frozen ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
HasFile ⚠System Default Encoding Deprecated - Py_
Hash ⚠Randomization Flag Non- Py_LIMITED_API
- Py_
Ignore ⚠Environment Flag Deprecated Non- Py_LIMITED_API
- Py_
Inspect ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
Interactive ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
Isolated ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
NoSite ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
NoUser ⚠Site Directory Deprecated Non- Py_LIMITED_API
- Py_
Optimize ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
Quiet ⚠Flag Deprecated Non- Py_LIMITED_API
- Py_
Unbuffered ⚠Stdio Flag Deprecated Non- Py_LIMITED_API
- Py_
UseClass ⚠Exceptions Flag Deprecated Non- Py_LIMITED_API
- Py_
Verbose ⚠Flag Deprecated Non- Py_LIMITED_API
- _PyCoro
Wrapper_ ⚠Type Non- Py_LIMITED_API
- _PyManaged
Buffer_ ⚠Type Non- Py_LIMITED_API
- _PyMethod
Wrapper_ ⚠Type Non- Py_LIMITED_API
- _PySet_
Dummy ⚠Non- Py_LIMITED_API
Functions§
- PyAny
Set_ ⚠Check Exact Non- PyPy
- PyAsync
Gen_ ⚠Check Exact Non- Py_LIMITED_API
- PyBuffer_
Fill ⚠Contiguous Strides Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
Fill ⚠Info Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
From ⚠Contiguous Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
GetPointer ⚠Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
IsContiguous ⚠Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
Release ⚠Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
Size ⚠From Format Non- Py_3_11
and non-Py_LIMITED_API
- PyBuffer_
ToContiguous ⚠Non- Py_3_11
and non-Py_LIMITED_API
- PyCFunction_
Call ⚠Deprecated Non- Py_3_13
- PyCFunction_
Check ⚠Py_3_9
- PyCFunction_
Check ⚠Exact Py_3_9
- PyCFunction_
GET_ ⚠CLASS Py_3_9
and non-PyPy
and non-Py_LIMITED_API
and non-GraalPy
- PyCFunction_
GET_ ⚠FLAGS Py_3_9
and non-PyPy
and non-Py_LIMITED_API
and non-GraalPy
- PyCFunction_
GET_ ⚠FUNCTION Py_3_9
and non-PyPy
and non-Py_LIMITED_API
and non-GraalPy
- PyCFunction_
GET_ ⚠SELF Py_3_9
and non-PyPy
and non-Py_LIMITED_API
and non-GraalPy
- PyCFunction_
New ⚠Py_3_9
- PyCFunction_
NewEx ⚠Py_3_9
- PyCMethod_
Check ⚠Py_3_9
and non-PyPy
and non-Py_LIMITED_API
- PyCMethod_
Check ⚠Exact Py_3_9
and non-PyPy
and non-Py_LIMITED_API
- PyCMethod_
New ⚠Py_3_9
- PyCode_
Addr2 ⚠Line Non- Py_LIMITED_API
and non-GraalPy
- PyCode_
Check ⚠Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyCode_
GetNum ⚠Free Neither PyPy
norGraalPy
andPy_3_10
and non-Py_3_11
and non-Py_LIMITED_API
- PyCode_
New ⚠Non- Py_LIMITED_API
and non-GraalPy
- PyCode_
NewEmpty ⚠Non- Py_LIMITED_API
and non-GraalPy
- PyCode_
NewWith ⚠PosOnly Args Non- Py_LIMITED_API
and non-GraalPy
andPy_3_8
- PyCode_
Optimize ⚠Non- Py_LIMITED_API
- PyCodec_
Unregister ⚠Py_3_10
and non-PyPy
- PyCompile_
Opcode ⚠Stack Effect Non- Py_LIMITED_API
- PyCompile_
Opcode ⚠Stack Effect With Jump Non- Py_LIMITED_API
andPy_3_8
- PyComplex_
AsCComplex ⚠Non- Py_LIMITED_API
- PyComplex_
FromC ⚠Complex Non- Py_LIMITED_API
- PyConfig_
Clear ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
Init ⚠Isolated Config Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
Init ⚠Python Config Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
Read ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
SetArgv ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
SetBytes ⚠Argv Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
SetBytes ⚠String Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
SetString ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyConfig_
SetWide ⚠String List Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyContext
Token_ ⚠Check Exact Py_3_8
and non-Py_LIMITED_API
- PyContext
Var_ ⚠Check Exact Py_3_8
and non-Py_LIMITED_API
- PyContext
Var_ ⚠Get Py_3_8
and non-Py_LIMITED_API
- PyContext
Var_ ⚠New Py_3_8
and non-Py_LIMITED_API
- PyContext
Var_ ⚠Reset Py_3_8
and non-Py_LIMITED_API
- PyContext
Var_ ⚠Set Py_3_8
and non-Py_LIMITED_API
- PyContext_
Check ⚠Exact Py_3_8
and non-Py_LIMITED_API
- PyContext_
Copy ⚠Py_3_8
and non-Py_LIMITED_API
- PyContext_
Copy ⚠Current Py_3_8
and non-Py_LIMITED_API
- PyContext_
Enter ⚠Py_3_8
and non-Py_LIMITED_API
- PyContext_
Exit ⚠Py_3_8
and non-Py_LIMITED_API
- PyContext_
New ⚠Py_3_8
and non-Py_LIMITED_API
- PyCoro_
Check ⚠Exact Non- Py_LIMITED_API
- PyDate
TimeAPI ⚠Non- Py_LIMITED_API
Returns a pointer to aPyDateTime_CAPI
instance - PyDate
Time_ ⚠Check Non- Py_LIMITED_API
Check ifop
is aPyDateTimeAPI.DateTimeType
or subtype. - PyDate
Time_ ⚠Check Exact Non- Py_LIMITED_API
Check ifop
’s type is exactlyPyDateTimeAPI.DateTimeType
. - PyDate
Time_ ⚠DATE_ GET_ FOLD Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the fold component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 1]
- PyDate
Time_ ⚠DATE_ GET_ HOUR Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the hour component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 23]
- PyDate
Time_ ⚠DATE_ GET_ MICROSECOND Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the microsecond component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 999999]
- PyDate
Time_ ⚠DATE_ GET_ MINUTE Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the minute component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 59]
- PyDate
Time_ ⚠DATE_ GET_ SECOND Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the second component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 59]
- PyDate
Time_ ⚠DATE_ GET_ TZINFO Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the tzinfo component of aPyDateTime_DateTime
. Returns a pointer to aPyObject
that should be either NULL or an instance of adatetime.tzinfo
subclass. - PyDate
Time_ ⚠DELTA_ GET_ DAYS Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the days component of aPyDateTime_Delta
. - PyDate
Time_ ⚠DELTA_ GET_ MICROSECONDS Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the seconds component of aPyDateTime_Delta
. - PyDate
Time_ ⚠DELTA_ GET_ SECONDS Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the seconds component of aPyDateTime_Delta
. - PyDate
Time_ ⚠From Timestamp Non- Py_LIMITED_API
and non-PyPy
- PyDate
Time_ ⚠GET_ DAY Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the day component of aPyDateTime_Date
orPyDateTime_DateTime
. Returns a signed integer in the interval[1, 31]
. - PyDate
Time_ ⚠GET_ MONTH Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the month component of aPyDateTime_Date
orPyDateTime_DateTime
. Returns a signed integer in the range[1, 12]
. - PyDate
Time_ ⚠GET_ YEAR Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the year component of aPyDateTime_Date
orPyDateTime_DateTime
. Returns a signed integer greater than 0. - PyDate
Time_ ⚠IMPORT Non- Py_LIMITED_API
Populates thePyDateTimeAPI
object - PyDate
Time_ ⚠TIME_ GET_ FOLD Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the fold component of aPyDateTime_Time
. Returns a signed integer in the interval[0, 1]
- PyDate
Time_ ⚠TIME_ GET_ HOUR Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the hour component of aPyDateTime_Time
. Returns a signed integer in the interval[0, 23]
- PyDate
Time_ ⚠TIME_ GET_ MICROSECOND Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the microsecond component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 999999]
- PyDate
Time_ ⚠TIME_ GET_ MINUTE Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the minute component of aPyDateTime_Time
. Returns a signed integer in the interval[0, 59]
- PyDate
Time_ ⚠TIME_ GET_ SECOND Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the second component of aPyDateTime_DateTime
. Returns a signed integer in the interval[0, 59]
- PyDate
Time_ ⚠TIME_ GET_ TZINFO Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Retrieve the tzinfo component of aPyDateTime_Time
. Returns a pointer to aPyObject
that should be either NULL or an instance of adatetime.tzinfo
subclass. - PyDate
Time_ ⚠Time Zone_ UTC Non- Py_LIMITED_API
- PyDate_
Check ⚠Non- Py_LIMITED_API
Type Check macros - PyDate_
Check ⚠Exact Non- Py_LIMITED_API
Check ifop
’s type is exactlyPyDateTimeAPI.DateType
. - PyDate_
From ⚠Timestamp Non- Py_LIMITED_API
and non-PyPy
- PyDelta_
Check ⚠Non- Py_LIMITED_API
Check ifop
is aPyDateTimeAPI.DetaType
or subtype. - PyDelta_
Check ⚠Exact Non- Py_LIMITED_API
Check ifop
’s type is exactlyPyDateTimeAPI.DeltaType
. - PyErr_
SetInterrupt ⚠Ex Py_3_10
- PyEval_
Call ⚠Function Deprecated Non- Py_3_13
- PyEval_
Call ⚠Method Deprecated Non- Py_3_13
- PyEval_
Call ⚠Object Deprecated Non- Py_3_13
- PyEval_
Call ⚠Object With Keywords Deprecated Non- Py_3_13
- PyEval_
Init ⚠Threads Deprecated - PyEval_
SetProfile ⚠Non- PyPy
and non-Py_LIMITED_API
- PyEval_
SetTrace ⚠Non- PyPy
and non-Py_LIMITED_API
- PyEval_
Threads ⚠Initialized Deprecated Non- Py_3_13
- PyException
Instance_ ⚠Class Non- PyPy
- PyFloat_
AS_ ⚠DOUBLE Non- Py_LIMITED_API
- PyFrame_
Block ⚠Pop Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
norPy_3_11
- PyFrame_
Block ⚠Setup Non- Py_LIMITED_API
- PyFrame_
Check ⚠Non- Py_LIMITED_API
- PyFrame_
Fast ⚠ToLocals Non- Py_LIMITED_API
- PyFrame_
Fast ⚠ToLocals With Error Non- Py_LIMITED_API
- PyFrame_
GetCode ⚠Non- GraalPy
and (Py_3_10
, orPy_3_9
and non-Py_LIMITED_API
) - PyFrame_
Locals ⚠ToFast Non- Py_LIMITED_API
- PyFrame_
New ⚠Non- Py_LIMITED_API
and non-GraalPy
- PyFrozen
Set_ ⚠Check Non- PyPy
- PyFrozen
Set_ ⚠Check Exact Neither PyPy
norGraalPy
- PyFunction_
Check ⚠Non- Py_LIMITED_API
and not (PyPy
and non-Py_3_8
) - PyFunction_
GetAnnotations ⚠Non- Py_LIMITED_API
- PyFunction_
GetClosure ⚠Non- Py_LIMITED_API
- PyFunction_
GetCode ⚠Non- Py_LIMITED_API
- PyFunction_
GetDefaults ⚠Non- Py_LIMITED_API
- PyFunction_
GetGlobals ⚠Non- Py_LIMITED_API
- PyFunction_
GetKw ⚠Defaults Non- Py_LIMITED_API
- PyFunction_
GetModule ⚠Non- Py_LIMITED_API
- PyFunction_
New ⚠Non- Py_LIMITED_API
- PyFunction_
NewWith ⚠Qual Name Non- Py_LIMITED_API
- PyFunction_
SetAnnotations ⚠Non- Py_LIMITED_API
- PyFunction_
SetClosure ⚠Non- Py_LIMITED_API
- PyFunction_
SetDefaults ⚠Non- Py_LIMITED_API
- PyFunction_
SetKw ⚠Defaults Non- Py_LIMITED_API
- PyGC_
Disable ⚠Py_3_10
- PyGC_
Enable ⚠Py_3_10
- PyGC_
IsEnabled ⚠Py_3_10
- PyGIL
State_ ⚠Check Non- Py_LIMITED_API
- PyGIL
State_ ⚠GetThis Thread State Non- PyPy
- PyGen_
Check ⚠Non- Py_LIMITED_API
- PyGen_
Check ⚠Exact Non- Py_LIMITED_API
- PyGen_
New ⚠Non- Py_LIMITED_API
- PyHash_
GetFunc ⚠Def Neither Py_LIMITED_API
norPyPy
norGraalPy
- PyHeap
Type_ ⚠GET_ MEMBERS Non- Py_LIMITED_API
and non-Py_3_11
- PyImport_
Extend ⚠Inittab Non- Py_LIMITED_API
and non-PyPy
- PyIndex_
Check ⚠Neither Py_LIMITED_API
norPyPy
- PyInterpreter
State_ ⚠Clear Non- PyPy
- PyInterpreter
State_ ⚠Delete Non- PyPy
- PyInterpreter
State_ ⚠Get Py_3_9
and non-PyPy
- PyInterpreter
State_ ⚠GetDict Py_3_8
and non-PyPy
- PyInterpreter
State_ ⚠GetID Non- PyPy
- PyInterpreter
State_ ⚠Head Non- Py_LIMITED_API
- PyInterpreter
State_ ⚠Main Non- Py_LIMITED_API
and non-PyPy
- PyInterpreter
State_ ⚠New Non- PyPy
- PyInterpreter
State_ ⚠Next Non- Py_LIMITED_API
- PyInterpreter
State_ ⚠Thread Head Non- Py_LIMITED_API
and non-PyPy
- PyIter_
Check ⚠Py_3_8
orPyPy
- PyIter_
Send ⚠Non- PyPy
andPy_3_10
- PyList_
GET_ ⚠ITEM Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Macro, trading safety for speed - PyList_
GET_ ⚠SIZE Non- Py_LIMITED_API
and non-PyPy
- PyList_
SET_ ⚠ITEM Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Macro, only to be used to fill in brand new lists - PyMapping_
Length ⚠Non- PyPy
- PyMem_
GetAllocator ⚠Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyMem_
RawCalloc ⚠Non- Py_LIMITED_API
- PyMem_
RawFree ⚠Non- Py_LIMITED_API
- PyMem_
RawMalloc ⚠Non- Py_LIMITED_API
- PyMem_
RawRealloc ⚠Non- Py_LIMITED_API
- PyMem_
SetAllocator ⚠Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyMem_
Setup ⚠Debug Hooks Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyMemory
View_ ⚠From Buffer Py_3_11
or non-Py_LIMITED_API
- PyModule_
AddObject ⚠Ref Py_3_10
- PyModule_
AddType ⚠Py_3_10
, orPy_3_9
and non-Py_LIMITED_API
- PyModule_
Create2 ⚠Non- py_sys_config="Py_TRACE_REFS"
- PyModule_
From ⚠DefAnd Spec2 Non- py_sys_config="Py_TRACE_REFS"
- PyModule_
GetFilename ⚠Deprecated Not (Windows and PyPy
) - PyModule_
GetFilename ⚠Object Non- PyPy
- PyModule_
GetName ⚠Object Non- PyPy
- PyOS_
After ⚠Fork Deprecated - PyObject_
Call ⚠Finalizer Non- Py_LIMITED_API
- PyObject_
Call ⚠Finalizer From Dealloc Non- Py_LIMITED_API
- PyObject_
Call ⚠Method NoArgs Py_3_9
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- PyObject_
Call ⚠Method OneArg Py_3_9
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- PyObject_
Call ⚠NoArgs Non- PyPy
and non-GraalPy
and (Py_3_10
, or non-Py_LIMITED_API
andPy_3_9
) - PyObject_
Call ⚠OneArg Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- PyObject_
Check ⚠Buffer Non- Py_LIMITED_API
and non-Py_3_11
andPy_3_9
and neitherPyPy
norGraalPy
- PyObject_
Copy ⚠Data Non- Py_3_11
and non-Py_LIMITED_API
- PyObject_
DelAttr ⚠Non- Py_3_13
and non-PyPy
- PyObject_
DelAttr ⚠String Non- Py_3_13
and non-PyPy
- PyObject_
GC_ ⚠IsFinalized Py_3_9
and non-PyPy
, orPy_3_10
- PyObject_
GC_ ⚠IsTracked Py_3_9
and non-PyPy
, orPy_3_10
- PyObject_
GC_ ⚠Track Non- PyPy
- PyObject_
GC_ ⚠UnTrack Non- PyPy
- PyObject_
GET_ ⚠WEAKREFS_ LISTPTR Non- Py_LIMITED_API
- PyObject_
Generic ⚠GetDict Not ( Py_LIMITED_API
and non-Py_3_10
) - PyObject_
GetArena ⚠Allocator Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyObject_
GetBuffer ⚠Non- Py_3_11
and non-Py_LIMITED_API
- PyObject_
IS_ ⚠GC Non- Py_LIMITED_API
andPy_3_9
- PyObject_
Length ⚠Hint Non- Py_LIMITED_API
- PyObject_
Print ⚠Non- Py_LIMITED_API
- PyObject_
SetArena ⚠Allocator Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyObject_
Vectorcall ⚠Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- PyObject_
Vectorcall ⚠Dict Non- Py_LIMITED_API
andPy_3_8
- PyObject_
Vectorcall ⚠Method Py_3_9
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- PyPre
Config_ ⚠Init Isolated Config Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyPre
Config_ ⚠Init Python Config Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyRun_
AnyFile ⚠Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
AnyFile ⚠Ex Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
AnyFile ⚠ExFlags Non- Py_LIMITED_API
- PyRun_
AnyFile ⚠Flags Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
File ⚠Non- Py_LIMITED_API
- PyRun_
File ⚠Ex Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
File ⚠ExFlags Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
File ⚠Flags Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
Interactive ⚠Loop Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
Interactive ⚠Loop Flags Non- Py_LIMITED_API
- PyRun_
Interactive ⚠One Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
Interactive ⚠OneFlags Non- Py_LIMITED_API
- PyRun_
Interactive ⚠OneObject Non- Py_LIMITED_API
- PyRun_
Simple ⚠File Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
Simple ⚠File Ex Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyRun_
Simple ⚠File ExFlags Non- Py_LIMITED_API
- PyRun_
Simple ⚠String Non- Py_LIMITED_API
- PyRun_
Simple ⚠String Flags Non- Py_LIMITED_API
- PyRun_
String ⚠Non- Py_LIMITED_API
- PyRun_
String ⚠Flags Non- Py_LIMITED_API
- PySequence_
Length ⚠Non- PyPy
- PySet_
Check ⚠Non- PyPy
- PySet_
Check ⚠Exact Py_3_10
- PySet_
GET_ ⚠SIZE Neither PyPy
norGraalPy
and non-Py_LIMITED_API
- PyStatus_
Error ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStatus_
Exception ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStatus_
Exit ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStatus_
IsError ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStatus_
IsExit ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStatus_
NoMemory ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStatus_
Ok ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyStruct
Sequence_ ⚠GET_ ITEM Neither Py_LIMITED_API
norPyPy
norGraalPy
- PyStruct
Sequence_ ⚠GetItem Non- PyPy
- PyStruct
Sequence_ ⚠Init Type Non- Py_LIMITED_API
- PyStruct
Sequence_ ⚠Init Type2 Non- Py_LIMITED_API
- PyStruct
Sequence_ ⚠NewType Non- PyPy
- PyStruct
Sequence_ ⚠SET_ ITEM Neither Py_LIMITED_API
norPyPy
norGraalPy
- PyStruct
Sequence_ ⚠SetItem Non- PyPy
- PyTZ
Info_ ⚠Check Non- Py_LIMITED_API
Check ifop
is aPyDateTimeAPI.TZInfoType
or subtype. - PyTZ
Info_ ⚠Check Exact Non- Py_LIMITED_API
Check ifop
’s type is exactlyPyDateTimeAPI.TZInfoType
. - PyThread
State_ ⚠Delete Current Non- Py_LIMITED_API
- PyThread
State_ ⚠Next Non- Py_LIMITED_API
and non-PyPy
- PyThread
State_ ⚠SetAsync Exc Non- PyPy
- PyTime
Zone_ ⚠From Offset Non- Py_LIMITED_API
- PyTime
Zone_ ⚠From Offset AndName Non- Py_LIMITED_API
- PyTime_
Check ⚠Non- Py_LIMITED_API
Check ifop
is aPyDateTimeAPI.TimeType
or subtype. - PyTime_
Check ⚠Exact Non- Py_LIMITED_API
Check ifop
’s type is exactlyPyDateTimeAPI.TimeType
. - PyTrace
Back_ ⚠Check Non- PyPy
- PyTuple_
GET_ ⚠ITEM Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- PyTuple_
GET_ ⚠SIZE Non- Py_LIMITED_API
and non-PyPy
Macro, trading safety for speed - PyTuple_
SET_ ⚠ITEM Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
Macro, only to be used to fill in brand new tuples - PyType_
From ⚠Module AndSpec Py_3_10
, orPy_3_9
and non-Py_LIMITED_API
- PyType_
GetModule ⚠Py_3_10
, orPy_3_9
and non-Py_LIMITED_API
- PyType_
GetModule ⚠State Py_3_10
, orPy_3_9
and non-Py_LIMITED_API
- PyType_
SUPPORTS_ ⚠WEAKREFS Non- Py_LIMITED_API
- PyUnicode
Decode ⚠Error_ Create Non- PyPy
- PyUnicode_
1BYTE_ ⚠DATA Non- Py_LIMITED_API
and neitherGraalPy
norPyPy
- PyUnicode_
2BYTE_ ⚠DATA Non- Py_LIMITED_API
and neitherGraalPy
norPyPy
- PyUnicode_
4BYTE_ ⚠DATA Non- Py_LIMITED_API
and neitherGraalPy
norPyPy
- PyUnicode_
AsUT ⚠F8 Non- Py_LIMITED_API
- PyUnicode_
AsUT ⚠F8And Size Py_3_10
or non-Py_LIMITED_API
- PyUnicode_
AsUnicode ⚠Deprecated Non- Py_LIMITED_API
and non-Py_3_12
- PyUnicode_
AsUnicode ⚠AndSize Deprecated Non- Py_LIMITED_API
and non-Py_3_12
- PyUnicode_
Check ⚠Non- PyPy
- PyUnicode_
Check ⚠Exact Non- PyPy
- PyUnicode_
Copy ⚠Characters Non- Py_LIMITED_API
and non-PyPy
- PyUnicode_
DATA ⚠Non- Py_LIMITED_API
and neitherGraalPy
norPyPy
- PyUnicode_
Encode ⚠Non- Py_LIMITED_API
- PyUnicode_
EncodeASCII ⚠Non- Py_LIMITED_API
- PyUnicode_
Encode ⚠Charmap Non- Py_LIMITED_API
- PyUnicode_
Encode ⚠Decimal Non- Py_LIMITED_API
- PyUnicode_
Encode ⚠Latin1 Non- Py_LIMITED_API
- PyUnicode_
Encode ⚠RawUnicode Escape Non- Py_LIMITED_API
- PyUnicode_
EncodeUT ⚠F7 Non- Py_LIMITED_API
- PyUnicode_
EncodeUT ⚠F8 Non- Py_LIMITED_API
- PyUnicode_
EncodeUT ⚠F16 Non- Py_LIMITED_API
- PyUnicode_
EncodeUT ⚠F32 Non- Py_LIMITED_API
- PyUnicode_
Encode ⚠Unicode Escape Non- Py_LIMITED_API
- PyUnicode_
Fill ⚠Non- Py_LIMITED_API
and non-PyPy
- PyUnicode_
From ⚠Kind AndData Non- Py_LIMITED_API
- PyUnicode_
From ⚠Unicode Deprecated Non- Py_LIMITED_API
and non-Py_3_12
- PyUnicode_
GET_ ⚠LENGTH Non- Py_LIMITED_API
and non-GraalPy
- PyUnicode_
GetSize ⚠Deprecated Non- Py_3_12
- PyUnicode_
IS_ ⚠ASCII Non- Py_LIMITED_API
and non-GraalPy
- PyUnicode_
IS_ ⚠COMPACT Non- Py_LIMITED_API
and non-GraalPy
- PyUnicode_
IS_ ⚠COMPACT_ ASCII Non- Py_LIMITED_API
and non-GraalPy
- PyUnicode_
IS_ ⚠READY Non- Py_LIMITED_API
and neitherGraalPy
norPy_3_12
- PyUnicode_
Intern ⚠Immortal Deprecated Non- Py_3_12
- PyUnicode_
KIND ⚠Non- Py_LIMITED_API
and non-GraalPy
- PyUnicode_
New ⚠Non- Py_LIMITED_API
- PyUnicode_
READY ⚠Non- Py_LIMITED_API
and neitherPy_3_12
norGraalPy
- PyUnicode_
Transform ⚠Decimal ToASCII Non- Py_LIMITED_API
- PyUnicode_
Translate ⚠Charmap Non- Py_LIMITED_API
- PyVectorcall_
Call ⚠Non- Py_LIMITED_API
andPy_3_8
- PyVectorcall_
Function ⚠Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- PyVectorcall_
NARGS ⚠Non- Py_LIMITED_API
andPy_3_8
- PyWeakref_
Check ⚠Proxy Non- PyPy
- PyWeakref_
Check ⚠Ref Non- PyPy
- PyWeakref_
Check ⚠RefExact Non- PyPy
- PyWide
String ⚠List_ Append Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- PyWide
String ⚠List_ Insert Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
Compile ⚠String Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- Py_
Compile ⚠String ExFlags Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- Py_
Compile ⚠String Flags Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- Py_
Compile ⚠String Object Non- Py_LIMITED_API
- Py_
Enter ⚠Recursive Call Py_3_9
- Py_
Exit ⚠Status Exception Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
GETENV ⚠Non- Py_LIMITED_API
and non-Py_3_11
- Py_
GetArgc ⚠Argv Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
Initialize ⚠From Config Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
Leave ⚠Recursive Call Py_3_9
- Py_
NewRef ⚠Py_3_10
- Py_
PreInitialize ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
PreInitialize ⚠From Args Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
PreInitialize ⚠From Bytes Args Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
RunMain ⚠Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- Py_
SetPath ⚠Non- Py_3_13
- Py_
XNew ⚠Ref Py_3_10
- _PyBytes_
Resize ⚠Non- Py_LIMITED_API
- _PyCode_
GetExtra ⚠Non- Py_LIMITED_API
- _PyCode_
SetExtra ⚠Non- Py_LIMITED_API
- _PyDict_
Contains_ ⚠Known Hash Non- PyPy
and non-Py_LIMITED_API
andPy_3_10
- _PyDict_
NewPresized ⚠Non- PyPy
and non-Py_LIMITED_API
- _PyDict_
Next ⚠Non- PyPy
and non-Py_LIMITED_API
- _PyDict_
SetItem_ ⚠Known Hash Non- PyPy
and non-Py_LIMITED_API
- _PyEval_
Eval ⚠Frame Default Non- PyPy
and non-Py_LIMITED_API
and non-Py_3_11
- _PyEval_
Request ⚠Code Extra Index Non- PyPy
and non-Py_LIMITED_API
- _PyFloat_
CAST ⚠Non- Py_LIMITED_API
- _PyImport_
Acquire ⚠Lock Non- Py_LIMITED_API
- _PyImport_
Find ⚠Extension Object Non- Py_LIMITED_API
and non-Py_3_11
- _PyImport_
Fixup ⚠Builtin Non- Py_LIMITED_API
- _PyImport_
Fixup ⚠Extension Object Non- Py_LIMITED_API
- _PyImport_
IsInitialized ⚠Non- Py_LIMITED_API
- _PyImport_
Release ⚠Lock Non- Py_LIMITED_API
- _PyImport_
SetModule ⚠Non- Py_LIMITED_API
- _PyImport_
SetModule ⚠String Non- Py_LIMITED_API
- _PyInterpreter
State_ ⚠GetEval Frame Func Py_3_9
and non-Py_LIMITED_API
Get the frame evaluation function. - _PyInterpreter
State_ ⚠SetEval Frame Func Py_3_9
and non-Py_LIMITED_API
Set the frame evaluation function. - _PyLong_
AsByte ⚠Array Non- Py_LIMITED_API
- _PyLong_
From ⚠Byte Array Non- Py_LIMITED_API
- _PyLong_
NumBits ⚠Non- Py_LIMITED_API
- _PyObject_
Call ⚠Function_ SizeT Non- Py_3_13
- _PyObject_
Call ⚠Method_ SizeT Non- Py_3_13
- _PyObject_
Call ⚠NoArg Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _PyObject_
Fast ⚠Call Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _PyObject_
Fast ⚠Call Tstate Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _PyObject_
GC_ ⚠Calloc Non- Py_3_11
and non-Py_LIMITED_API
- _PyObject_
GC_ ⚠Malloc Non- Py_3_11
and non-Py_LIMITED_API
- _PyObject_
Make ⚠TpCall Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _PyObject_
Vectorcall ⚠Tstate Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _PyRun_
AnyFile ⚠Object Non- Py_LIMITED_API
- _PyRun_
Interactive ⚠Loop Object Non- Py_LIMITED_API
- _PyRun_
Simple ⚠File Object Non- Py_LIMITED_API
- _PySequence_
Iter ⚠Search Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- _PySet_
Next ⚠Entry Non- Py_LIMITED_API
- _PyStack_
AsDict ⚠Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _PyUnicode_
COMPACT_ ⚠DATA Non- Py_LIMITED_API
and non-GraalPy
- _PyUnicode_
Check ⚠Consistency Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
- _PyUnicode_
NONCOMPACT_ ⚠DATA Non- Py_LIMITED_API
and neitherGraalPy
norPyPy
- _PyUnicode_
Ready ⚠Non- Py_LIMITED_API
- _Py_
Check ⚠Function Result Py_3_8
and neitherPyPy
norGraalPy
and non-Py_LIMITED_API
- _Py_
GetAllocated ⚠Blocks Non- Py_3_11
and non-Py_LIMITED_API
- _Py_
Hash ⚠Bytes Neither Py_LIMITED_API
norPyPy
norGraalPy
- _Py_
Initialize ⚠Main Py_3_8
and non-PyPy
and non-Py_LIMITED_API
- _Py_
IsCore ⚠Initialized Py_3_8
and non-PyPy
and non-Py_LIMITED_API
Type Aliases§
- PyCFunction
Fast Py_3_10
or non-Py_LIMITED_API
- PyCFunction
Fast With Keywords Py_3_10
or non-Py_LIMITED_API
- PyCMethod
Py_3_9
and non-Py_LIMITED_API
- PyFrame
State Non- Py_LIMITED_API
and neitherPyPy
norGraalPy
norPy_3_11
- PyObject
ObRefcnt Non- Py_3_12
and non-Py_GIL_DISABLED
- PyStruct
Sequence Non- Py_LIMITED_API
- Py_
UNICODE Non- Py_LIMITED_API
- Py_
tracefunc Non- Py_LIMITED_API
- _PyC
Function Fast Deprecated Py_3_10
or non-Py_LIMITED_API
- _PyC
Function Fast With Keywords Deprecated Py_3_10
or non-Py_LIMITED_API
- _PyFrame
Eval Function Py_3_9
and non-Py_3_11
and non-Py_LIMITED_API
- getbufferproc
Non- Py_3_11
and non-Py_LIMITED_API
- printfunc
Non- Py_LIMITED_API
- releasebufferproc
Non- Py_3_11
and non-Py_LIMITED_API
- sendfunc
Non- Py_LIMITED_API
andPy_3_10
- vectorcallfunc
Py_3_8
- wrapperfunc
Non- Py_LIMITED_API
- wrapperfunc_
kwds Non- Py_LIMITED_API
Unions§
- Function types used to implement Python callables.
- PyUnicode
Object Data Non- Py_LIMITED_API