Expand description
Store of metadata for generating Python stub file
Stub file generation takes two steps:
§Store metadata (compile time)
Embed compile-time information about Rust types and PyO3 macro arguments using inventory::submit! macro into source codes, and these information will be gathered by inventory::iter. This submodule is responsible for this process.
- PyClassInfo stores information obtained from
#[pyclass]
macro - PyMethodsInfo stores information obtained from
#[pymethods]
macro
and others are their components.
§Gathering metadata and generating stub file (runtime)
Since #[pyclass]
and #[pymethods]
definitions are not bundled in a single block,
we have to reconstruct these information corresponding to a Python class
.
This process is done at runtime in gen_stub executable.
Structs§
- ArgInfo
- Info of method argument appears in
#[pymethods]
- Deprecated
Info - Information about deprecated items
- Member
Info - Info of getter method decorated with
#[getter]
or#[pyo3(get, set)]
appears in#[pyclass]
- Method
Info - Info of usual method appears in
#[pymethod]
- PyClass
Info - Info of
#[pyclass]
with Rust struct - PyComplex
Enum Info - Info of a
#[pyclass]
with a rich (structured) Rust enum - PyEnum
Info - Info of
#[pyclass]
with Rust enum - PyFunction
Info - Info of
#[pyfunction]
- PyMethods
Info - Info of
#[pymethod]
- PyVariable
Info - Variant
Info - Info of a
#[pyclass]
with a single variant of a rich (structured) Rust enum
Enums§
- Ignore
Target - Represents the target of type ignore comments
- Method
Type - Type of a method
- Signature
Arg - Variant
Form
Functions§
- compare_
op_ type_ input - Work around for
CompareOp
for__richcmp__
argument, which does not implementsFromPyObject
- no_
return_ type_ output