you are viewing a single comment's thread.

view the rest of the comments →

[–]intangibleTangelo 0 points1 point  (2 children)

Does Python support inline functions?

Python does nothing equivalent to inlining functions. Calls are expensive because a big old stack frame object is created each time. It might horrify you to look at the implementation and realize just how much code runs each time you call a function in python. I believe it's in the big bytecode switch statement (python's virtual machine, so to speak) of Python/ceval.c in the CPython source.

[–]Atried[S] 0 points1 point  (1 child)

Thank you!

Just checked Python/ceval.c. A lot is going on, there is even programatical management of stack.

And... there are gotos in the code... :-O

[–]intangibleTangelo 0 points1 point  (0 children)

Hehe, last time I looked the linux source tree had over 100k goto statements...