1 | //! Raw FFI declarations for Python's C API. |
2 | //! |
3 | //! This module provides low level bindings to the Python interpreter. |
4 | //! It is meant for advanced users only - regular PyO3 users shouldn't |
5 | //! need to interact with this module at all. |
6 | //! |
7 | //! The contents of this module are not documented here, as it would entail |
8 | //! basically copying the documentation from CPython. Consult the [Python/C API Reference |
9 | //! Manual][capi] for up-to-date documentation. |
10 | //! |
11 | //! # Safety |
12 | //! |
13 | //! The functions in this module lack individual safety documentation, but |
14 | //! generally the following apply: |
15 | //! - Pointer arguments have to point to a valid Python object of the correct type, |
16 | //! although null pointers are sometimes valid input. |
17 | //! - The vast majority can only be used safely while the GIL is held. |
18 | //! - Some functions have additional safety requirements, consult the |
19 | //! [Python/C API Reference Manual][capi] |
20 | //! for more information. |
21 | //! |
22 | //! [capi]: https://docs.python.org/3/c-api/index.html |
23 | |
24 | #[cfg (test)] |
25 | mod tests; |
26 | |
27 | // reexport raw bindings exposed in pyo3_ffi |
28 | pub use pyo3_ffi::*; |
29 | |
30 | /// Helper to enable #\[pymethods\] to see the workaround for __ipow__ on Python 3.7 |
31 | #[doc (hidden)] |
32 | pub use crate::impl_::pymethods::ipowfunc; |
33 | |