Class methods in 2.2a2
26 Aug
2001
26 Aug
'01
10:41 p.m.
Self-less classes: it's now possible to define methods with no self argument. The methods may be invoked even with no instance of the class being created:
class foo: ... def add(a,b): ... return a+b ... add = staticmethod(add) ...
foo.add(3,4) 7 g = foo() g.add(1,2) 3
Yes, I've been reading the PEPs -- obviously. E.g.: http://python.sourceforge.net/peps/pep-0253.html Kirby
8474
Age (days ago)
8474
Last active (days ago)
1 comments
2 participants
participants (2)
-
agauld@crosswinds.net
-
Kirby Urner