Skip to content

Commit 88a8a30

Browse files
authored
fix case of checking truthiness of NotImplemented (#1298)
1 parent 2415f42 commit 88a8a30

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/serializers/filter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ fn map_negative_index<'py>(value: &Bound<'py, PyAny>, len: Option<usize>) -> PyR
2323
.unwrap_or_else(|_| value.clone())),
2424
None => {
2525
// check that it's not negative
26-
let negative = value.call_method1(intern!(py, "__lt__"), (0,))?.is_truthy()?;
27-
if negative {
26+
if value.lt(0).unwrap_or(false) {
2827
Err(PyValueError::new_err(
2928
"Negative indices cannot be used to exclude items on unsized iterables",
3029
))

0 commit comments

Comments
 (0)