From 39b66ad8e9b4edf3862fe7714362c56d476b5ef0 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Tue, 21 Jun 2011 20:02:12 -0400 Subject: [PATCH] add row pop --- tablib/core.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tablib/core.py b/tablib/core.py index 9c561fd..054d542 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -571,6 +571,15 @@ class Dataset(object): self.rpush(row, tags) + def pop(self): + """Removes and returns the last row of the :class:`Dataset`.""" + + cache = self[-1] + del self[-1] + + return cache + + # ------- # Columns # -------