Serhiy Storchaka added the comment: Yes, but if n is limited, O(n) becomes O(1). In our case n is the number of fed but not read lines. I suppose the worst case is a number of empty lines, in this case n=8192. I tried following microbenchmark and did not noticed significant difference.
$ ./python -m timeit -s "from email.parser import Parser; d = 'From: exam...@example.com\n\n' + '\n' * 100000" -- "Parser().parsestr(d)" ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21448> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com