Uplevel functionality

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Wed Dec 31 19:24:39 EST 2003


On Wed, 31 Dec 2003 12:41:02 -0500, rumours say that "Terry Reedy"
<tjreedy at udel.edu> might have written:

>> This allows me to do:
>>
>> repeat 5 {puts "hello"}
>>
>> prints:
>> hello
>> hello
>> hello
>> hello
>> hello
>
>for i in range(5): print 'hello' # does same thing.
>repeat(5, "print 'hello'")       # even if possible, saves all of 5 key
>strokes
>repeat(5, lambda: print 'hello') # possible, without uplevel, takes 2 more

print is invalid in a lambda (like other statements) as you most surely
know.  I would guess the champagne is to blame? :-) Happy new year!
-- 
TZOTZIOY, I speak England very best,
Ils sont fous ces Redmontains! --Harddix



More information about the Python-list mailing list