diff options
| author | Kenneth Reitz <me@kennethreitz.com> | 2011-06-21 20:03:50 -0400 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.com> | 2011-06-21 20:03:50 -0400 |
| commit | 39c6ea6503526ee07a0b6b7f86487f1c0c3bc48a (patch) | |
| tree | 67d7a77abccb64f937567cb258e46c0206211fed | |
| parent | 39b66ad8e9b4edf3862fe7714362c56d476b5ef0 (diff) | |
| download | tablib-39c6ea6503526ee07a0b6b7f86487f1c0c3bc48a.tar.gz | |
lpop/rpop
| -rw-r--r-- | tablib/core.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tablib/core.py b/tablib/core.py index 054d542..e93d454 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -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 # ------- |
