[Python-Dev] Re: PEP 563 in light of PEP 649

2021年4月19日 14:05:56 -0700

On 2021年4月19日 13:37:56 -0700
Ethan Furman <[email protected]> wrote:
> On 4/19/21 10:51 AM, Larry Hastings wrote:
> 
> > Something analogous /could/ happen in the PEP 649 branch but currently 
> > doesn't. When running Inada Noki's benchmark, 
> > there are a total of nine possible annotations code objects. Except, each 
> > function generated by the benchmark has a 
> > unique name, and I incorporate that name into the name given to the code 
> > object (f"{function_name}.__co_annotations__"). 
> > Since each function name is different, each code object name is different, 
> > so each code object /hash/ is different, and 
> > since they aren't /exact/ duplicates they are never consolidated. 
> 
> I hate anonymous functions, so the name is very important to me.
You are unlikely to notice the name of the code object underlying
__co_annotations__, aren't you?
> Or maybe the name can be store when running in debug mode, and not stored 
> with -O ?
Almost nobody uses -O. Optimizations that are enabled only in -O are
useless.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/BVPWTWVKFEL4XNSWSELWY5DW62DNWY64/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to