OO-programming question
Rainer Deyke
root at rainerdeyke.com
Sun Sep 3 20:07:37 EDT 2000
More information about the Python-list mailing list
Sun Sep 3 20:07:37 EDT 2000
- Previous message (by thread): OO-programming question
- Next message (by thread): OO-programming question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Alex Martelli" <aleaxit at yahoo.com> wrote in message news:8ou9i4029q1 at news2.newsguy.com... > def allbases(aclass, baselist=[]): > baselist.append(aclass) > bases=aclass.__bases__ > for base in bases: > allbases(base, baselist) > return baselist > > def allclasses(aninstance): > return allbases(aninstance.__class__) This will break the second time allclasses is called. Don't use mutable default args unless you really know what you're doing. -- Rainer Deyke (root at rainerdeyke.com) Shareware computer games - http://rainerdeyke.com "In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
- Previous message (by thread): OO-programming question
- Next message (by thread): OO-programming question
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list