C Gillespie wrote:
Dear All,
I ran my code through pylint to clean it up and one of the (many) errors it
through up was
Dangerous default value {} as argument
Bascially, I have:

class NewClass:
    def __init__(self,  myDict={}):
        for key, value in myDict:
            print key, value

Obviously, this is not the way it should be done. Should I have a default
value of None for myDict and test for it? Or is there some other way?

Take a look at:

http://www.python.org/doc/2.4/tut/node6.html#SECTION006710000000000000000

look for "Important warning"


HTH -- //// (@ @) ----------------------------oOO----(_)----OOo-------------------------- <> Ojo por ojo y el mundo acabara ciego /\ Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) -----------------------------------------------------------------------

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

Reply via email to