← Back to context

Comment by BerislavLopac

13 days ago

> Everything in Python is evaluated at runtime

That is not correct. Python generally has two "runtimes": one is on import, when all of the module level code is evaluated; and the runtime, when the bodies of various functions and methods are evaluated. The two can be combined, e.g. by importing a module from within a function, but generally they are separate.

> Bytecode is just a form of caching

Not quite. It is perfectly possible to deploy just the bytecode and disable recompiling on import.

> Python doesn't have a standard

Of course it does -- CPython is the reference implementation, so its behaviour is "correct".