On Sat, Dec 07, 2019 at 07:37:58PM +0000, Oscar Benjamin wrote:
I recently hit on a situation that created a one million line code file: https://github.com/pytest-dev/pytest/issues/4406#issuecomment-439629715
The original file (which is included in SymPy) has 3000 lines averaging 500 characters per line so that the total file is 1.5MB. Since it is a test file pytest rewrites the corresponding pyc file and adds extra lines to annotate the intermediate results in the large expressions. The pytest-rewritten code has just over a million lines.
If I'm reading you correctly, you're saying that, on average, pytest annotates each line of source code with over 300 additional lines of code.
When I first tried pytest with this file it lead to a CPython segfault. It seems that the crash in CPython was fixed in 3.7.1 though so subsequent versions can work fine with this (although it is slow).
Thanks, this is a good practical anecdote of real-life experience. -- Steven