Skip to content

Update to PyO3 Bound API#10

Merged
bisho merged 1 commit into
mainfrom
03-10-upgrade_to_pyo3_0.28.2
Mar 24, 2026
Merged

Update to PyO3 Bound API#10
bisho merged 1 commit into
mainfrom
03-10-upgrade_to_pyo3_0.28.2

Conversation

@bisho
Copy link
Copy Markdown
Member

@bisho bisho commented Mar 11, 2026

Motivation / Description

This pull request modernizes the PyO3 bindings to use the newer Bound<'py, T> API instead of the legacy Py<T> API. The changes improve type safety and align with current PyO3 best practices by making Python object lifetimes more explicit.

Changes introduced

  • Updated function signatures in build_cmd, build_meta_get, build_meta_set, build_meta_delete, and build_meta_arithmetic to use explicit lifetime parameters and return Bound<'py, PyBytes> instead of Py<PyBytes>
  • Removed manual .into() conversions when creating PyBytes objects since PyBytes::new() now directly returns the bound type
  • Added eq and skip_from_py_object attributes to RequestFlags and ResponseFlags pyclass declarations
  • Added frozen attribute to ResponseFlags pyclass declaration
  • Removed manual __eq__ method implementations from both flag classes since they're now handled automatically by the eq attribute
  • Updated to_bytes method in RequestFlags to return Bound<'py, PyBytes> with explicit lifetime parameter

@bisho bisho force-pushed the 03-10-upgrade_to_pyo3_0.28.2 branch from a3ee3f3 to 3c19e11 Compare March 11, 2026 17:31
@bisho bisho changed the base branch from 03-10-optimizations_and_improvements to graphite-base/10 March 16, 2026 16:09
@bisho bisho force-pushed the graphite-base/10 branch from 050ec63 to 593dbc0 Compare March 16, 2026 16:09
@bisho bisho force-pushed the 03-10-upgrade_to_pyo3_0.28.2 branch from 3c19e11 to 3516571 Compare March 16, 2026 16:09
@bisho bisho changed the base branch from graphite-base/10 to main March 16, 2026 16:09
This was referenced Mar 17, 2026
Copy link
Copy Markdown
Member Author

bisho commented Mar 24, 2026

Merge activity

  • Mar 24, 4:58 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 24, 4:58 PM UTC: @bisho merged this pull request with Graphite.

@bisho bisho merged commit 3584719 into main Mar 24, 2026
31 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants