Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 3
    "The change of exec in Python 3 is good. Because of optimization." What the hell are you talking about? We've just became more limited and less flexible, and pure Python is still among the slowest languages. How is that change good? Otherwise, good clarification. Commented Aug 30, 2019 at 12:47
  • @AnatolyAlekseev You are right! We lost flexibility. So "better" just is my opinion. But that's the same with self-modifying assembly code. CPUs cannot apply optimizations (pipelining etc.) to self modifying code. The same applies for exec here, as you now have far less possible sideffects to the local scope. Hence many optimizations can survive the exec-call now. And there are Python compilers out there which, very likely, could do a better job with the new exec from Python3. Probably they don't (yet), but this is something completely different. Commented Sep 6, 2019 at 15:01