On 7/27/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > james_027 schrieb: > > hi, > > > > is cls & self the same thing? > > > > I have seen something like > > > > class A: > > def dosomething(cls): > > #doing something > > > > How is cls & self differ? How is it use? > > cls and self are just names. And you most certainly haven't seen the > above, but this instead: >
Quite likely he has seen this, except there followed many other lines and then dosomething = classmethod(dosomething) at the end. This disjoint between where it's declared (and looks like a method) and where it's set to a classmethod was a primary factor behind the decorator syntax, of course. -- http://mail.python.org/mailman/listinfo/python-list