List::pop_back
pub fn pop_back() -> Option<T> Import
Source: use collections::list::{List}; src/collections/list.hy Removes and returns the back value, or None when the list is empty.
Walks the list, so it takes time proportional to its length.
Called on a List value as value.pop_back(…).
Returns#
Option<T>
Contracts#
Checked according to --contracts (see Contracts).
ensures self.len == old(self.len) - 1 || (old(self.len) == 0 && self.len == 0)
See also#
List: A singly-linked list with constant-time push and pop at the front.List::new: Creates an empty list.List::size: Returns the number of values.List::is_empty: Returnstruewhen the list has no values.List::push_front: Addsvat the front.List::push_back: Addsvat the back.List::peek_front: Returns the front value without removing it, orNonewhen the list is empty.List::pop_front: Removes and returns the front value, orNonewhen the list is empty.