Skip to content

Commit 5826647

Browse files
committed
Update Pyo3 to 0.23.3
1 parent cd364ad commit 5826647

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

Cargo.lock

+23-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cachebox"
3-
version = "4.4.0"
3+
version = "4.4.1"
44
edition = "2021"
55
description = "The fastest memoizing and caching Python library written in Rust"
66
readme = "README.md"
@@ -22,15 +22,15 @@ strip = "symbols"
2222

2323
[dependencies]
2424
hashbrown = { version = "^0.14", default-features = false, features=["inline-more", "raw"]}
25-
fastrand = "^2.1"
26-
pyo3 = { version = "0.23.1", default-features = false, features=["macros", "extension-module"] }
25+
fastrand = "^2.3"
26+
pyo3 = { version = "0.23.3", default-features = false, features=["macros", "extension-module"] }
2727
cfg-if = "1.0"
2828
parking_lot_core = { version = "^0.9", default-features = false }
2929
lock_api = { version = "^0.4", default-features = false }
3030
fxhash = {version = "^0.2"}
3131

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

3535
[lints.clippy]
3636
dbg_macro = "warn"

src/internal/ttl.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ impl TTLPolicy {
102102
self.entries.len() + self.n_shifts,
103103
);
104104
}
105+
105106
self.entries.push_back(element);
106107
None
107108
}
@@ -222,7 +223,7 @@ impl TTLPolicy {
222223

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

227228
self.expire();
228229

@@ -240,7 +241,9 @@ impl TTLPolicy {
240241

241242
Ok(())
242243
} else {
243-
for pair in iterable.bind(py).try_iter()? {
244+
let iterator = PyIterator::from_object(iterable.bind(py))?;
245+
246+
for pair in iterator {
244247
let (key, value) = pair?.extract::<(pyo3::PyObject, pyo3::PyObject)>()?;
245248

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

0 commit comments

Comments
 (0)