The Python Oracle

Why is putting the module level code into a function and then calling the function is faster in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Hypnotic Puzzle3

--

Chapters
00:00 Question
00:33 Accepted answer (Score 8)
01:15 Thank you

--

Full question
https://stackoverflow.com/questions/8053...

Question links:
[Making a Python script Object-Oriented]: https://stackoverflow.com/questions/1813...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #function #optimization #module

#avk47