pola-rs / polars

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

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

Open itamarst opened 1 month ago

itamarst commented 1 month 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 month ago

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