Dec. 18th, 2007

netp_npokon: (geek)
Наши друзья с альтернативных блог-серверов интересуются, почему вот такой код:
fs = []

for x in [1, 2, 3]:
    fs.append(lambda : x)

for f in fs:
    print f(),

печатает 3 3 3 вместо 1 2 3.
Read more... )

Profile

netp_npokon: (Default)
netp_npokon

April 2017

S M T W T F S
      1
23 45678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 27th, 2025 02:46 am
Powered by Dreamwidth Studios