Skip to content

Commit

Permalink
Update Pyo3 to 0.23.3
Browse files Browse the repository at this point in the history
  • Loading branch information
awolverp committed Dec 19, 2024
1 parent cd364ad commit 5826647
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cachebox"
version = "4.4.0"
version = "4.4.1"
edition = "2021"
description = "The fastest memoizing and caching Python library written in Rust"
readme = "README.md"
Expand All @@ -22,15 +22,15 @@ strip = "symbols"

[dependencies]
hashbrown = { version = "^0.14", default-features = false, features=["inline-more", "raw"]}
fastrand = "^2.1"
pyo3 = { version = "0.23.1", default-features = false, features=["macros", "extension-module"] }
fastrand = "^2.3"
pyo3 = { version = "0.23.3", default-features = false, features=["macros", "extension-module"] }
cfg-if = "1.0"
parking_lot_core = { version = "^0.9", default-features = false }
lock_api = { version = "^0.4", default-features = false }
fxhash = {version = "^0.2"}

[build-dependencies]
pyo3-build-config = { version = "0.23.1", features = ["resolve-config"] }
pyo3-build-config = { version = "0.23.3", features = ["resolve-config"] }

[lints.clippy]
dbg_macro = "warn"
Expand Down
7 changes: 5 additions & 2 deletions src/internal/ttl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ impl TTLPolicy {
self.entries.len() + self.n_shifts,
);
}

self.entries.push_back(element);
None
}
Expand Down Expand Up @@ -222,7 +223,7 @@ impl TTLPolicy {

#[inline]
pub fn update(&mut self, py: pyo3::Python<'_>, iterable: pyo3::PyObject) -> pyo3::PyResult<()> {
use pyo3::types::{PyAnyMethods, PyDictMethods};
use pyo3::types::{PyAnyMethods, PyDictMethods, PyIterator};

self.expire();

Expand All @@ -240,7 +241,9 @@ impl TTLPolicy {

Ok(())
} else {
for pair in iterable.bind(py).try_iter()? {
let iterator = PyIterator::from_object(iterable.bind(py))?;

for pair in iterator {
let (key, value) = pair?.extract::<(pyo3::PyObject, pyo3::PyObject)>()?;

let hk = HashedKey::from_pyobject(py, key)?;
Expand Down

0 comments on commit 5826647

Please sign in to comment.