iteration over methods
Padraig Brady
padraig.brady at corvil.com
Tue Jan 7 06:41:14 EST 2003
More information about the Python-list mailing list
Tue Jan 7 06:41:14 EST 2003
- Previous message (by thread): iteration over methods
- Next message (by thread): iteration over methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
How about:
class Someclass:
def __init__(self):
pass
def method1(self):
pass
def method2(self):
pass
def runallmethods(self):
for name, func in self.__class__.__dict__.items():
if name[0:6] == 'method':
func(self)
Pádraig.
- Previous message (by thread): iteration over methods
- Next message (by thread): iteration over methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list