One thought that I had is the fact that this whole proposal seems to be
based on code blocks never needing to be collected?

given the program:


def fun1(v):

    return v


def fun2(v)

    return v+1


fun1 = fun2


The function code block that was originally bound to the name fun1
should now be collected, as it is no longer referenced.

And, if this code is all in module mod1, there could be way off
somewhere else, in code that imports this module a statement like

mod1.fun1 = fun2

The classic "Monkey Patch"

So the compiler can't know if the code object really will be eternal, at
best it knows that the code object can only be generated once by how it
was compiled, so if we allow it to be leaked we have a finite loss.
_______________________________________________
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/JY5PZT7IVTNUUH6UXMMBYYKSVIHT47UZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to