pola-rs / polars

Dataframes powered by a multithreaded, vectorized query engine, written in Rust
https://docs.pola.rs
Other
29.67k stars 1.9k forks source link

When Python 3.10 is minimum supported version, PyBackedStr/PyBackedBytes may no longer be necessary #18974

Open itamarst opened 2 weeks ago

itamarst commented 2 weeks ago

Description

Per PyO3 migration guide:

To avoid needing to worry about lifetimes at all, it is also possible to use the new PyBackedStr type, which stores a reference to the Python str without a lifetime attachment. In particular, PyBackedStr helps for abi3 builds for Python older than 3.10. Due to limitations in the abi3 CPython API for those older versions, PyO3 cannot offer a FromPyObjectBound implementation for &str on those versions.

So some code processing bytes and strings may potentially be faster or simpler once Python 3.10 is the minimum supported version, by removing the need for PyBackedStr/PyBackedBytes.

alexander-beedie commented 1 week ago

Better set a calendar reminder for September/October 2025 😁📅