utility functions within a class?

John Salerno johnjsal at NOSPAMgmail.com
Sun May 7 23:19:46 EDT 2006


jeffshannon at gmail.com wrote:

> Even if you don't end up referring to self or any instance
> attributes within the method

Hmm, follow-up: I *do* plan to refer to instance attributes inside these 
methods (self.something), but does that require that they be instance 
methods, or can they still reference 'self' since they are inside the class?

They won't be called directly from an instance, which is why I wondered 
about making them static or class methods, but can static or class 
methods use self, or does it have to be an instance method in that case?



More information about the Python-list mailing list