To those who caught the colon at the end of what I thought was going to be def but turned out to be something else, thank.
On Wed, Dec 2, 2009 at 5:55 AM, Bruno Desthuilliers <bruno.42.desthuilli...@websiteburo.invalid> wrote: > 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) > Thanks for this instructive example. V
-- http://mail.python.org/mailman/listinfo/python-list