André Malo wrote:
> * Greg Ewing wrote:
 >
> > But you could just as well wrap
> > it in a function that takes self and discards it, 
> 
> I always thought, that this is exactly what staticmethod does.

Not quite -- staticmethod prevents a self from getting
passed in the first place, so there's no need to discard
it. Which is probably slightly more efficient, but if
unbound methods had never been invented in the first
place, I doubt that staticmethod would have been created
just for that reason.

The other thing about staticmethod is that it makes it
possible to call the method via either a class or an
instance, but I've never found a real need for that in
anything I've written or seen.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to