[Python-ideas] PEP 563: Postponed Evaluation of Annotations, first draft

Steven D'Aprano steve at pearwood.info
Tue Sep 12 07:35:05 EDT 2017


On Tue, Sep 12, 2017 at 09:17:23PM +1000, Nick Coghlan wrote:

> Unfortunately, this idea has the downside that for trivial
> annotations, defining a lambda expression is likely to be *slower*
> than evaluating the expression, whereas referencing a string constant
> is faster:

Is it time to consider a specialised, high-speed (otherwise there's no 
point) thunk that can implicitly capture the environment like a 
function, but has less overhead? For starters, you don't need to care 
about argument passing.


-- 
Steve


More information about the Python-ideas mailing list