From b23c9448b3e579bce352eba545f6a6541bf07d22 Mon Sep 17 00:00:00 2001 From: Mahmoud Hashemi Date: Wed, 20 Mar 2013 20:47:28 -0700 Subject: [PATCH] add reverse() to blist --- boltons/listutils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boltons/listutils.py b/boltons/listutils.py index 9d943ec..cff1f82 100644 --- a/boltons/listutils.py +++ b/boltons/listutils.py @@ -213,6 +213,11 @@ class BarrelList(object): self.lists[0] = sorted(chain(*[sorted(l) for l in self.lists])) self._balance_list(0) + def reverse(self): + for cur in self.lists: + cur.reverse() + self.lists.reverse() + def count(self, item): return sum([cur.count(item) for cur in self.lists])