mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
lpop/rpop
This commit is contained in:
+16
-1
@@ -571,7 +571,16 @@ class Dataset(object):
|
||||
self.rpush(row, tags)
|
||||
|
||||
|
||||
def pop(self):
|
||||
def lpop(self):
|
||||
"""Removes and returns the first row of the :class:`Dataset`."""
|
||||
|
||||
cache = self[0]
|
||||
del self[0]
|
||||
|
||||
return cache
|
||||
|
||||
|
||||
def rpop(self):
|
||||
"""Removes and returns the last row of the :class:`Dataset`."""
|
||||
|
||||
cache = self[-1]
|
||||
@@ -580,6 +589,12 @@ class Dataset(object):
|
||||
return cache
|
||||
|
||||
|
||||
def pop(self):
|
||||
"""Removes and returns the last row of the :class:`Dataset`."""
|
||||
|
||||
return self.rpop()
|
||||
|
||||
|
||||
# -------
|
||||
# Columns
|
||||
# -------
|
||||
|
||||
Reference in New Issue
Block a user