summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2011-06-21 20:02:12 -0400
committerKenneth Reitz <me@kennethreitz.com>2011-06-21 20:02:12 -0400
commit39b66ad8e9b4edf3862fe7714362c56d476b5ef0 (patch)
tree317136d13b42abc31a5ae7aa3cda06ebd34dd789
parent004b3da680b821d0dcedbe52ee6fb5a2a45c9ad5 (diff)
downloadtablib-39b66ad8e9b4edf3862fe7714362c56d476b5ef0.tar.gz
add row pop
-rw-r--r--tablib/core.py9
1 files changed, 9 insertions, 0 deletions
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
# -------