PyO3 / PyO3/pyo3

Support IntoPyObject for Arc in pyclass for pyo3(get)

Open
#4,887 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

I defined a class

#[pyclass(get_all)]
class MyClass {
  inner: Arc<Vec<String>>,
}

and I got the error below

`std::sync::Arc<std::vec::Vec<std::string::String>>` cannot be converted to a Python objec

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the pyclass(get) getter conversion path and the IntoPyObject implementations relevant to Arc<Vec>. Reproduce the issue with the MyClass example, then verify that the Arc-wrapped value converts to a Python object without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.