Source

pythonwise / ilast.py

Full commit
1
2
3
4
5
from collections import deque

def ilast(col, N):
    "Get last N items in collection"
    return deque(iter(col), N)