
15 May
2009
15 May
'09
2:05 a.m.
On Fri, 15 May 2009 02:16:04 pm Tennessee Leeuwenburg wrote:
A thought from another direction...
Any chance we could have the interpreter raise a warning for the case
def foo(a = []): #stuff
?
The empty list and empty dict args would, I imagine, be the two most common mistakes. Showing a warning might, at least, solve the problem of people tripping over the syntax.
I made that same suggestion nine months ago:
http://mail.python.org/pipermail/python-list/2008-August/504701.html
Responses were mixed, some people supported it, others did not, but it went nowhere.
--
Steven D'Aprano