functions, list, default parameters

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Tue Nov 2 13:14:55 CET 2010


On Tue, 02 Nov 2010 20:12:49 +1300, Lawrence D'Oliveiro wrote about 
mutable defaults:

> Which is what we’re talking about
> here: a language construct which is probably one of the top 3 sources of
> grief to Python newbies. And not-so-newbies.


I call bullshit. Maybe you should spend some time on the tutor at python.org 
mailing list for a while to see what the common problems newbies actually 
have. Mutable defaults are *way* down the list.

In any case, Python isn't written solely for newbies. Most people will 
make this mistake once, or twice if they're particularly slow learning. 
If newbies have a problem with mutable defaults, oh well, they'll learn, 
or they'll give up and go back to griefing their friends on Facebook. 
Either way, problem solved.


-- 
Steven



More information about the Python-list mailing list