![]() |
|
|
+ Search |
![]()
|
Jun 7th, 2002 09:42
Michael Chermside,
Python 2.2 has staticmethod and classmethod, which are used to create methods that belong more to the CLASS itself than to the instance. Two good places to read about this feature are: http://www.etsimo.uniovi.es/python/2.2/descrintro.html and http://www.amk.ca/python/2.2/ If you are still using Python 2.1 or earlier, than these won't help you, but there are still possible work-arounds: Staticmethod can be emulated quite well in python 2.1: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52304 Classmethod is a little more of a problem, but here is a solution that requires only minimal modification of code: http://groups.google.com/groups?th=4565ae6f1f3979cf