() to empty tuple conversion is confusing
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
I just managed to upgrade to the latest PyO3 and I was immediately bitten by the new () to empty tuple conversion. I was especially confused because there is a special case now that #[pyfunction] does actually still perform the old conversion, but into_py_any and friends do not.
I'm not sure what the motivation of this change was, but I now need to manually handle that case in a few places. Is there ever a situation where you want to treat () as an empty tuple?
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 tracing how () is converted by into_py_any and related APIs, then compare that behavior with the special case in #[pyfunction]. Determine whether treating () as an empty tuple is intended and define consistent behavior or documentation for the affected conversions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100