[Python-Dev] Re: Static method and class method comments

M.-A. Lemburg mal@lemburg.com
Thu, 26 Jul 2001 10:32:28 +0200

Skip Montanaro wrote:
>     Paul> Agree strongly. This will also be a problem for documentation
>     Paul> generation tools, type extraction tools and class browsers. I
>     Paul> believe it would be easy to add a contextual keyword
>     >> class C:
>     >>     def static foo(x, y):
>     >>         print "classmethod", x, y
> Even better yet, why not simply reuse the class keyword in this context:
>     class C:
>         def class foo(x, y):
>             print "classmethod", x, y

AFAIK, the only way to add classmethods to a class is by doing
so after creation of the class object. In that sense you don't have
a problem with parsing doc-extraction tools at all: they don't
have a chance of finding the class methods anyway ;-) 

Importing doc-extraction tools won't have a problem with these though 
and neither will human doc-extraction tools, since these will note
that the class methods are special :-)

Marc-Andre Lemburg
CEO eGenix.com Software GmbH
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/