-
Notifications
You must be signed in to change notification settings - Fork 837
Next steps for type introspection and stub generation #5137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For "custom type annotations", I think maybe adding it to // `a` and return type set explicitly, b will be inferred
#[pyo3(pyfunction, signature = (a: int, b) -> int)]
fn foo(a: i32, b: i32) -> i32 {
a + b
} ... I guess the alternative would be |
Hi, |
@yogevm15 Thank you! It would be amazing! I am currently working on function type annotations #5089 There are a bunch of topics that are quite independent from it like exposing To help you deep dive in the code:
Note that introspection is only working with modules declared using inline Rust modules ( |
Thanks, I'm not sure about the classes associated consts. If I understood the code correctly, it exports them as class methods rather than actual class variables. So, how should we generate them in the stub? |
Uh oh!
There was an error while loading. Please reload this page.
This is an incomplete list of next steps to build proper stubs from PyO3 codebases:
const
)const
)#[pyclass]
#[pyclass]
PYTHON_TYPE
constant on all implementations of the relevant traits (FromPyObject
andIntoPyObject
)#[classattr]
in the stubsmaturin
list[T]
instead oflist
). Blocked bygeneric_const_exprs
being unstable_typeshed.Incomplete
to relevant places (modules with a#[pymodule_init]
function...) (doc)_typeshed.Incomplete
andtyping.Any
in type annotationscfg
macros@overload
sReference on stubs file
The text was updated successfully, but these errors were encountered: