[Python-Dev] classmethod() and staticmethod()
Guido van Rossum
guido@python.org
Mon, 13 Aug 2001 21:58:03 -0400
> I'm very happy with the design for type-class unification -- it looks
> like an excellent move towards making Python more consistent and flexible.
Thanks!
> However, the mechanism for declaring class and static methods:
>
> class MyClass:
> def method(x, y): # part 1
> ...
>
> method = staticmethod(method) # part 2
>
> ...sticks out as awkward and strange to read. Kevin Smith and Paul
> Prescod commented earlier on this, and i agree with their opinion that
> a more direct declaration would be a better way to do this.
Understood, and agreed. It is my plan to eventually provide syntax
for this. However, right now I need to concentrate on getting the
underlying mechanisms to work. The unification is a lot of work, and
I'd like to finish the run-time before I start thinking about
syntactic sugar. I can't promise that I'll change the syntax before
2.2 is released -- there will be plenty of time after that, and there
are plenty of more important things to do before I can make the
release.
--Guido van Rossum (home page: http://www.python.org/~guido/)