PyO3 / PyO3/pyo3

GIL-free references to Python data

Open
#2,275 0 comments 0 reactions 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

In comment to Py<PyBytes>::as_bytes:


I think there's a few other immutable types like str and tuple which I guess can also have treatment like this where py is necessary for reading, but once read, the GIL can be released. Might be interesting to follow up this another time.

Originally posted by @davidhewitt in https://github.com/PyO3/pyo3/pull/2235#pullrequestreview-915041031

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 with the Py::as_bytes comment and the referenced PyO3 pull request #2235. Investigate whether immutable str and tuple access can safely release the GIL after reading, and define the scope and acceptance criteria before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.