wouldn't this suffice?
```
self.__line_buffer = (self.__line_buffer + [logline])[-self.__line_buffer_size:]
```