add deque __bool__ method (#2931)

Adds deque.bool
This commit is contained in:
Bonsai
2021-08-24 13:30:20 +08:00
committed by GitHub
parent d544988aa6
commit e66566f7b8

View File

@@ -472,6 +472,11 @@ mod _collections {
self.borrow_deque().len()
}
#[pymethod(magic)]
fn bool(&self) -> bool {
!self.borrow_deque().is_empty()
}
#[pymethod(magic)]
fn iadd(
zelf: PyRef<Self>,