-
Notifications
You must be signed in to change notification settings - Fork 875
Open
Labels
Description
This is an incomplete list of next steps to build proper stubs from PyO3 codebases:
- introspect all class methods (including adding a test for all magic methods) (partial: Refine some magic methods introspection #5273)
- introspect classes associated constants (
const
) Introspect class associated constants #5272 - introspect modules associated constants (
const
) add declarative module level constants export #5096 - introspect simple enums built by
#[pyclass]
- introspect complex enums built by
#[pyclass]
- introspect exceptions built by
create_exception!
- introspect class inheritance (
#[pyclass(extends=)]
) Introspection: Basic pyclass(extends) support #5331 -
@typing.final
decorator on class that cannot be subclasses (without#[pyclass(subclass)]
) - introspect auto-generated magic methods (
#[pyclass(eq, eq_int, ord, hash, str)]
) Generate introspection for #[pyclass(eq, eq_int, ord, hash, str)] #5338 - introspect fields getter and setter (
#[pyo3(get, set)]
,#[pyclass(get_all, set_all)]
) Introspection: support#[pyo3(get, set)]
and#[pyclass(get_all, set_all)]
#5370 - implement return type annotation Introspection: implement output type #5208
- fill
PYTHON_TYPE
constant on all implementations of the relevant traits (FromPyObject
andIntoPyObject
) - fill
INPUT_TYPE
in#[derive(FromPyObject)]
Basic introspection of #[derive(FromPyObject)] #5339 - fill
OUTPUT_TYPE
in#[derive(IntoPyObject)]
Basic introspection of #[derive(IntoPyObject)] #5365 - figure out how to emit
#[classattr]
in the stubs - support cross-modules types (class defined in module A and used in module B as an input/output type)
- add doc strings to the generated stubs
- proper test coverage
- proper formatting of stubs (not a blocker)
- integration into
maturin
- proper type stubs for containers (
list[T]
instead oflist
). Blocked bygeneric_const_exprs
being unstable - allow to set custom type annotations (both inputs and output) Introspection: allows to override annotations in signature #5241
- allow to set custom stubs for eg. protocols
- add
_typeshed.Incomplete
to relevant places (modules with a#[pymodule_init]
function...) (doc) Introspection: properly tag modules as incomplete when needed #5207 - choose between
_typeshed.Incomplete
andtyping.Any
in type annotations - make sure to properly gate introspection element with
cfg
macros - provide a way to set
@overload
s - Support WASM files in
pyo3-introspection
- Allow custom type annotations without strings (example:
#[pyo3(signature = (arg: list[int]) -> list[int])]
)
davidhewitt, clouds56, chingiztob, vigith, Fogapod and 12 more