manually implementing staticmethod()?

Alex Martelli aleax at mac.com
Thu Mar 29 17:34:54 CEST 2007


7stud <bbxx789_05ss at yahoo.com> 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



More information about the Python-list mailing list