How big can a Python program be?

Peter Hansen peter at engcorp.com
Tue Aug 17 09:45:52 EDT 2004


Ben Last wrote:
> Unless I've misremembered, the Python interpreter executes lines as they're
> entered, whether read from a file or typed in (with the exception that
> blocks of code made up of multiple lines are executed when the last line is
> complete), so in theory, one could feed code to Python indefinitely and it'd
> just keep going.  

You've misremembered.  Python actually *compiles* the code prior
to executing it, turning it into bytecode.  That means there is
definitely a limit on how much code can be handled, based if nothing
else on the memory in your PC.

-Peter



More information about the Python-list mailing list