A newbie question about class

Laura Creighton lac at strakt.com
Mon Feb 11 10:38:27 EST 2002


You can't write 

class doIt(value=something-mutable):

and get the behaviour you want.

Instead, the idiom is

class doIt(value=None):

and then test for None.

If you use == instead of is in your test then it will fail when it is
absolutely fine for what you get passed to redefine __cmp__ or __eq__.
And won't you look silly.

Laura Creighton




More information about the Python-list mailing list