24
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 29 Aug 2023
24 points (100.0% liked)
Rust
6402 readers
26 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 2 years ago
MODERATORS
That's a bummer. I guess what I though was PyO3 type hints was actually just PyCharm guessing at the types.
I tried creating a
.pyi
file and it seems to be a pretty big improvement over no type hints, but I don't know how to add type hints for modules added withPyModule::add_module
and adding the.pyi
file seems to make the type checker not know about my other modules.Would you mind sharing the script for auto generating type hints? Keeping them in sync manually would be pretty annoying.
Here's the script. It's nothing fancy, and iirc it only works for top level functions/classes. That means you still have to take care of attributes and methods which is a little annoying, but for simple stuff it should save a bit of time.