On 14 mai, 16:30, George Sakkis <[EMAIL PROTECTED]> wrote:
> On May 14, 10:19 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
> > > An instance method works on the instance
> > > A Static method is basically a function nested within a class object
> > > A class method is overkill?
>
> > If anything, a static method is overkill. See it this way: *if* you for some
> > reason put a method into an enclosing context - isn't it worth having a
> > reference to that?
>
> My feeling exactly; these days I almost always use class methods
> instead of static. I vaguely remember seeing somewhere an example
> where a static method was the only (elegant) solution; neither a class
> method nor a plain function would do. I'll post it if I find it unless
> someone beats me to it.

No concrete example here but I surely remember having used
staticmethods in one case where I needed class-based polymorphic
dispatch and eventually implementation inheritance (to get a default
implementation)  for something that didn't required access to the
class object.



> George

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to