Add macro for importing a type (ala import_exception)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
Currently import_exception makes it easy to import and use an exception type defined in Python from Rust. It'd be useful to have a generalized version of this that gave you a type.
Right now it can be accomplished by writing imperative py.import().getattr() statements, but these are quite verbose.
It'd be a big ergonomics win to have a builtin way to do this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the existing import_exception macro and the imperative py.import().getattr() pattern described in the issue. Define the generalized builtin macro's expected type-import behavior, then confirm it can replace the verbose sequence while yielding the requested Python type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- api, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100