Question on Bound & unbound methods
Aahz
aahz at pythoncraft.com
Fri May 16 15:54:33 EDT 2003
In article <3EC4A111.FC10CC1D at alcyone.com>,
Erik Max Francis <max at alcyone.com> wrote:
>
>In this case, if what you wanted was a static method, you should indeed
>use staticmethod:
>
> class C:
> def f(): ...
> f = staticmethod(f)
Although this works, I'd recommend deriving C from object; I'm not sure
to what extent this is intended to work.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles: boring syntax, unsurprising semantics,
few automatic coercions, etc etc. But that's one of the things I like
about it." --Tim Peters on Python, 16 Sep 93
More information about the Python-list
mailing list