[Python-Dev] RE: Python-Dev digest, Vol 1 #1324 - 16 msgs

Greg Ewing greg@cosc.canterbury.ac.nz
Mon, 23 Apr 2001 17:33:20 +1200 (NZST)


Tim Peters <tim.one@home.com>:

> "class methods" in *this* thread
> is being used in a Smalltalk sense (because it's Thomas Heller's thread, and
> he made clear that he doesn't want C++-style class statics).

It sounds like he wants not just class methods, but to
unify classes and instances the way they are in Smalltalk.

That's not necessary *just* to get class methods. For
instance, suppose you could write

  class Foo:

    def ftang(class c, x, y, z);
      ...

where the 'class' keyword in the argument list would say
that it is to be a class method. That special form of the
def statement would create an 'unbound class method'
object, whose first argument would be filled in with the
class object when Foo.ftang was accessed.

Hmmm... might write a PEP on that!

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+