On Mon, 9 May 2022 at 05:49, Marco Sulla <marco.sulla.pyt...@gmail.com> wrote: > Anyway, apart from my implementation, I'm curious if you think a tail > method is worth it to be a method of the builtin file objects in > CPython.
Absolutely not. As has been stated multiple times in this thread, a fully general approach is extremely complicated, horrifically unreliable, and hopelessly inefficient. The ONLY way to make this sort of thing any good whatsoever is to know your own use-case and code to exactly that. Given the size of files you're working with, for instance, a simple approach of just reading the whole file would make far more sense than the complex seeking you're doing. For reading a multi-gigabyte file, the choices will be different. No, this does NOT belong in the core language. ChrisA -- https://mail.python.org/mailman/listinfo/python-list