@mousetail can't you just scroll to the bottom of the last page? Seems to be that the most recently deleted answer is codegolf.meta.stackexchange.com/a/26071
Even in python 3*3 is exactly the same bytecode as 9
In C you can mark functions as constexprwhich means they can be evaluated at compile time for constant folding and other optimizations, in python it only applies to basic operators and maybe some basic builtin functions
@Simd Not at the bytecode compilating stage, pypy might be able to it during incremental JIT but still it would need to insert a check every time which will be slow
there is some weired edge cases around floats that make it sometimes really hard to guarentee the operation will have the same result at compile time and run time