Movatterモバイル変換


[0]ホーム

URL:


[Python-ideas] Efficient debug logging

Barry Scottbarry at barrys-emacs.org
Thu Feb 16 05:33:22 EST 2017


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 sugarof Steven’s <# … #>.Barry> On 15 Feb 2017, at 16:46, Sven R. Kunze <srkunze at 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 at python.org>https://mail.python.org/mailman/listinfo/python-ideas> Code of Conduct:http://python.org/psf/codeofconduct/>


More information about the Python-ideasmailing list

[8]ページ先頭

©2009-2026 Movatter.jp