On 9/12/21 2:07 am, TobiasHT wrote:
If a function fails to be inlined at compiletime due to dynamic behavior of python, then the normal function call behavior can be the fallback
The problem is that the compiler might *think* it knows where the module is at compile time, but at run time it turns out to be different. Maybe you could come up with some scheme to allow this to be detected and invalidate all the code resulting from inlining its functions, but that could get very complicated and it would be hard to be sure it works properly in all situations. Another thing to consider is that all this would only help with calling stand-alone functions, which is a relatively rare thing to do in Python. Most of the time you're calling a method of some object, and you don't know until each call which function that will be. That's another reason I'm doubtful it would help much in practice. -- Greg _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ONQMUNJGLASTQCVC7WPAWXKTMENOW2HP/ Code of Conduct: http://python.org/psf/codeofconduct/