why is there no class (static) methods in Python ?

Richard Gruet rgruet at intraware.com
Sun Jun 17 16:21:36 EDT 2001


Hi all,

I  (and other people on the Python french mail list) wonder  why there
are no class (static) methods in Python. You cannot define a really
unbounded (ie to an instance) method within the namespace of a class.
It's not natural nor elegant to have to create an instance to call a
method which is not related to a particular instance. We would like to
be able to write things like:

class C:
    def staticFoo(x): print x

C.staticFoo(1)


Cheers,

Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rgruet.vcf
Type: text/x-vcard
Size: 370 bytes
Desc: Card for Richard Gruet
URL: <http://mail.python.org/pipermail/python-list/attachments/20010617/3af6ce0b/attachment.vcf>


More information about the Python-list mailing list