utility functions within a class?
John Salerno
johnjsal at NOSPAMgmail.com
Tue May 9 10:19:31 EDT 2006
bruno at modulix wrote:
>> but these
>> functions will be called from another method in the class, not from the
>> instance itself.
>
> yes, they will:
>
> class Parrot(object):
> def _func1(self, whatever):
> print whatever
>
> def talk(self):
> self._func1('vroom')
> HTH.
yes, all your posts did help...this is exactly what i ended up doing,
and i see now why i needed to make them regular methods, despite the
fact that they weren't used outside the class (because the instance was
still used *inside* the class to call them)
More information about the Python-list
mailing list