[Python-ideas] Default arguments in Python - the return - running out of ideas but...

Tennessee Leeuwenburg tleeuwenburg at gmail.com
Fri May 15 06:16:04 CEST 2009


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.

Cheers,
-T
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090515/2a5b21a6/attachment.html>


More information about the Python-ideas mailing list