just because it's a nice solution:  if the files are not huge and one can read them, one can use a deque and write this in one line:

```python
from collections import deque

def tail(file_handler, window):
  return list(deque(file_handler, maxlen=window))
```