Scope confusion...

Rene Pijlman reageer.in at de.nieuwsgroep
Tue Jan 21 02:24:15 CET 2003


Kevin at Cazabon.com:
>I had a perplexing problem 
[...]
>def a(list = []):
[...]
>I would expect it to print "['test']" twenty times, correct?  It doesn't.

This is explained in section 4.7.1 of the Python tutorial:
http://www.python.org/doc/current/tut/node6.html

-- 
René Pijlman

Wat wil jij leren?  http://www.leren.nl




More information about the Python-list mailing list