Maybe we could specialize the heck out of this and not bother with a
function object? In the end we want to execute the code, the function
object is just a convenient way to bundle defaults, free variables (cells)
and globals. But co_annotation has no arguments or defaults, and is only
called once. It does need to have access to the globals of the definition
site (the call site may be in another module) and sometimes there are cells
(not sure).

On Thu, Aug 12, 2021 at 1:14 AM Inada Naoki <songofaca...@gmail.com> wrote:

> Lazy loading code object solves only a half of the problem.
> I am worrying about function objects for annotation too.
>
> Function objects are heavier than code objects. And they are GC-tracked
> objects.
>
> I want to know how we can reduce the function objects created for
> annotation in PEP 649, before deprecating PEP 563.
>
> --
> Inada Naoki  <songofaca...@gmail.com>
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/3DBMQJMD6JOXIE2O3CVUIDOJX6GRYG4P/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to