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)]) Introspection: add typing.final on final classes #5552
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 and IntoPyObject) Introspection: simplify code by leveraging that building type hint for containers now work #5634 Introspection: Declare INPUT_TYPE and OUTPUT_TYPE nearly everywhere #5637 Introspection: Set INPUT_TYPE and OUTPUT_TYPE on Vec<_> and &[] #5639 Introspection: properly set OUTPUT_TYPE on IntoPyObject implementations for Bound, Borrow and Py and add a PyTypeCheck bound to them #5640
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 Introspection: expose #[classattribute] as an attribute #5839
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 Introspection: emit doc comments #5782
proper test coverage
proper formatting of stubs (not a blocker)
integration into maturin
proper type stubs for containers (list[T] instead of list). Introspection: Set INPUT_TYPE and OUTPUT_TYPE on Vec<_> and &[] #5639
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 and typing.Any in type annotations
make sure to properly gate introspection element with cfg macros
provide a way to set @overloads
Support WASM files in pyo3-introspection
Allow custom type annotations without strings (example: #[pyo3(signature = (arg: list[int]) -> list[int])])
Add version information to the generated JSON blobs
Figure out if the function used to tag incomplete modules should be generated by pyo3-macros instead
Make sure we don't try to import None from builtins, it does not work
Reference on stubs file
This is an incomplete list of next steps to build proper stubs from PyO3 codebases:
const) Introspect class associated constants #5272const) add declarative module level constants export #5096#[pyclass]#[pyclass]create_exception!#[pyclass(extends=)]) Introspection: Basic pyclass(extends) support #5331@typing.finaldecorator on class that cannot be subclasses (without#[pyclass(subclass)]) Introspection: add typing.final on final classes #5552#[pyclass(eq, eq_int, ord, hash, str)]) Generate introspection for #[pyclass(eq, eq_int, ord, hash, str)] #5338#[pyo3(get, set)],#[pyclass(get_all, set_all)]) Introspection: support#[pyo3(get, set)]and#[pyclass(get_all, set_all)]#5370PYTHON_TYPEconstant on all implementations of the relevant traits (FromPyObjectandIntoPyObject) Introspection: simplify code by leveraging that building type hint for containers now work #5634 Introspection: Declare INPUT_TYPE and OUTPUT_TYPE nearly everywhere #5637 Introspection: Set INPUT_TYPE and OUTPUT_TYPE on Vec<_> and &[] #5639 Introspection: properly set OUTPUT_TYPE on IntoPyObject implementations for Bound, Borrow and Py and add a PyTypeCheck bound to them #5640INPUT_TYPEin#[derive(FromPyObject)]Basic introspection of #[derive(FromPyObject)] #5339OUTPUT_TYPEin#[derive(IntoPyObject)]Basic introspection of #[derive(IntoPyObject)] #5365#[classattr]in the stubs Introspection: expose#[classattribute]as an attribute #5839maturinlist[T]instead oflist). Introspection: Set INPUT_TYPE and OUTPUT_TYPE on Vec<_> and &[] #5639_typeshed.Incompleteto relevant places (modules with a#[pymodule_init]function...) (doc) Introspection: properly tag modules as incomplete when needed #5207_typeshed.Incompleteandtyping.Anyin type annotationscfgmacros@overloadspyo3-introspection#[pyo3(signature = (arg: list[int]) -> list[int])])Nonefrombuiltins, it does not workReference on stubs file