Mercurial > magic
changeset 223:2648422dfeff
created
| author | 127.0.0.1 |
|---|---|
| date | Sun, 30 Jun 2013 10:01:30 +0200 |
| parents | 8c2c41312f53 |
| children | b1445e602b59 |
| files | ___%2Aitem__ |
| diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/___%2Aitem__ Sun Jun 30 09:41:27 2013 +0200 +++ b/___%2Aitem__ Sun Jun 30 10:01:30 2013 +0200 @@ -9,5 +9,8 @@ thing.__delitem__(key) thing[start:end:step] -thing[slice(start, end, step)] +def get_slice(thing, start, end, step): + if hasattr(thing, '__getslice__'): + return thing.__getslice__(start, end, step) + thing[slice(start, end, step)] }}} \ No newline at end of file
