win32all-142 available (Long)
Carl Caulkett
carlca at dircon.co.uk
Sat Jan 5 20:20:44 EST 2002
More information about the Python-list mailing list
Sat Jan 5 20:20:44 EST 2002
- Previous message (by thread): win32all-142 available (Long)
- Next message (by thread): win32all-142 available (Long)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <mailman.1010272507.6806.python-list at python.org>, jason at jorendorff.com says... > #------------------------------------------------------ > > # NEW CODE BEGIN > > #------------------------------------------------------ > > if hasattr(ob, "__class__"): > > allitems = [] > > allitems.extend(_get_class_attributes(ob.__class__)) > > for item in allitems: > > if not item in items: > > items = items + item > > I think you probably mean this. > > if hasattr(ob, "__class__"): > for item in _get_class_attributes(ob.__class__): > if item not in items: > items.append(item) Your version is much more elegant, but, I'm sure that you would concede, functionally identical. In my defense, I was so excited at having found and fixed this (I am a recently converted Python devotee) that I neglected to put the code through my usual rigorous 3 day "before hitting the send button" refactoring session. :^) -- Carl
- Previous message (by thread): win32all-142 available (Long)
- Next message (by thread): win32all-142 available (Long)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list