FAQ
"Mel Wilson" <mwilson at the-wire.com> schrieb im Newsbeitrag
news:obgU/ks/KbsM089yn at the-wire.com...
In article <bislss$ckt13$1 at ID-67890.news.uni-berlin.de>,
"Ulrich Petri" wrote:
IIRC Default values are not created each time the function called but
rather
only the first time (am i correct here?). And since a list is mutable it
"rememberes" the previous value.
Default values are created when the 'def' statement is
executed,
This seems to be generally a somewhat underestimated issue...

See this example:
while c:
b=Button(...)
b.config(command=lambda x=b: doSomething(x))

This would not work otherwise...


Kindly
Michael P

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 7 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 31, '03 at 10:36a
activeAug 31, '03 at 8:05p
posts7
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase