per9000 wrote:

> A good idea could be to change the header of the first one (if you want
> the option to start counting from zero) into:
> def dict_add(inlist,indict={},init=1):

make that

def dict_add(inlist, indict=None, init=1):
    if indict is None:
        indict = {}

See "5. Mutable default arguments" at
http://zephyrfalcon.org/labs/python_pitfalls.html for an explanation.

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

Reply via email to