Re: manually implementing staticmethod()?

2007-04-01 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: ... > I'm using python 2.3.5. > > On Mar 29, 9:34 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > > Simplest way: > > > > class smethod(object): > > def __init__(self, f): self.f=f > > def __call__(self, *a, **k): return self.f(*a, **k) > > > > Alex > > Inte

Re: manually implementing staticmethod()?

2007-03-30 Thread 7stud
Hi, Thanks for the responses. On Mar 28, 4:01 pm, "Michael Spencer" <[EMAIL PROTECTED]> wrote: > "7stud" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED]> Hi, > > > Can someone show me how to manually implement staticmethod()? Here is > > my latest attempt: > > >

Re: manually implementing staticmethod()?

2007-03-29 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: > Hi, > > Can someone show me how to manually implement staticmethod()? Here is Simplest way: class smethod(object): def __init__(self, f): self.f=f def __call__(self, *a, **k): return self.f(*a, **k) Alex -- http://mail.python.org/mailman/listinfo/pytho

Re: manually implementing staticmethod()?

2007-03-28 Thread Michael Spencer
"7stud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Can someone show me how to manually implement staticmethod()? Here is > my latest attempt: > Raymond Hettinger can: http://users.rcn.com/python/download/Descriptor.htm#static-methods-and-class-methods

manually implementing staticmethod()?

2007-03-28 Thread 7stud
Hi, Can someone show me how to manually implement staticmethod()? Here is my latest attempt: def smethod(func): def newFunc(): pass def newGet(): print "new get" newFunc.__get__ = newGet return newFunc class Tes