[Python-ideas] Revised^4 PEP on yield-from

Raymond Hettinger python at rcn.com
Wed Feb 25 20:47:13 CET 2009


[Greg Ewing]
>> The hasattr() tests can be expensive for repeated throwers and senders.
>> Any merit to caching the result of the test?
> 
> The expansion is a specification of the semantics, not
> an implementation.

I would have thought that running hasattr() no more than 
once is a semantic detail.

Also, speed is a relevant consideration whenever users
have the choice of continuing to do things the old way.
If the new syntax is slower for key use cases, why would
anyone adopt it?

my-two-cents-ly yours,


Raymond



More information about the Python-ideas mailing list