The Python community has a 5 year plan to push the limit of speed in Python. One of the things that reduces Python execution speed is calling methods or functions that are not in the nearest scope.
My suggestion is to introduce inline functions just as they are in C. They can be defined as global functions or class methods but are created in the scope of the function that is calling it at parsetime. I also don’t think it’ll be hard to adapt. inline functions might look something like:
inline def func(): pass
inline async def func(): pass
inline class Executor: inline def func(): pass
For an inline method, the class must be defined as inline as well, in order to bring to scope whatever class variable or method that the inline function might rely on.
This is just a suggestion, what do you guys think about it.