So if python converted:

        debugLog( <# ‘format string %r’ % (expensive(),) #> )

Into:

        def __tmp__():
                yield ‘format string %r’ % (expensive(),)

        debugLog( __tmp__ )

Then debugLog can detect the generator and call __next__ only if logging is 
enabled.

I guess at that point its the same as using the lambda but you have the syntax 
sugar
of Steven’s <# … #>.

Barry


> On 15 Feb 2017, at 16:46, Sven R. Kunze <srku...@mail.de> wrote:
> 
> On 15.02.2017 12:55, Barry Scott wrote:
>> The lazy eval sound like a generator.
>> 
> 
> Exactly my thought.
> 
> 
> Sven
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
> 

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to