error: 'staticmethod' object is not callable
mwh at python.net
Wed Feb 11 16:20:23 CET 2004
Michal Vitecek <fuf at mageo.cz> writes:
> Peter Otten wrote:
> >You are wrapping method2() twice:
> >class A(object):
> > def method(parA):
> > print "in A.method()"
> > method = staticmethod(staticmethod(method))
> >Why would you expect this to work?
> i don't expect this to work. i just don't get it why python allows this
> double wrapping of a method. it cannot be used for anything reasonable,
> can it?
Hmm, in Python 2.3 the classmethod constructor checks its argument for
callability, but the staticmethod constructor doesn't seem to. I
guess this is just oversight...
59. In English every word can be verbed. Would that it were so in
our programming languages.
-- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html
More information about the Python-list