Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] PEP 342: simple example, closure alternative

Guido van Rossumgvanrossum at gmail.com
Fri Aug 26 16:57:08 CEST 2005


On 8/25/05, Ian Bicking <ianb at colorstudy.com> wrote:> More generally, I've been doing some language comparisons, and I don't> like literal but non-idiomatic translations of programming patterns.True. (But that doesn't mean I think using generators for this exampleis great either.)> So I'm considering better ways to translate some of the same use cases.Remember that this particuar example was invented to show thesuperiority of Lisp; it has no practical value when taken literally.If you substitute a method call for the "acc += incr" operation, thePython translation using nested functions is very natural. For largerexamples, I'd recommend defining a class as always.-- --Guido van Rossum (home page:http://www.python.org/~guido/)


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp