On Wed, Dec 2, 2009 at 2:33 AM, Victor Subervi <victorsube...@gmail.com> wrote:

def colors(callingTable, which='', specificTables=[]):

Warning : default arguments are eval'd only once, at function creation time. This is a well known gotcha that can lead to unexpected behaviours like:


def foo(x, bar=[])
   bar.append("gotcha %s" % x)
   print bar

for i in range(5):
   bar(i)


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to