Would Anonymous Functions Help in Learning Programming/Python?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Fri Sep 21 20:14:52 EDT 2007


Kay Schluehr a écrit :
(snip)
> 
> I checked out Io once and I disliked it. I expected Io's prototype OO
> being just a more flexible variant of class based OO but Io couples a
> prototype very closely to its offspring. When A produces B and A.f is
> modified after production of B also B.f is modified. A controls the
> state of B during the whole lifetime of B. I think parents shall not
> do this, not in real life and also not in programming language
> semantics.

I may totally miss the point, but how is this different from:

class A(object):
     def dothis(self):
         print "A.dothis(%s)" % self

class B(A):
     pass

b = B()

b.dothis()

def dothat(self):
     print "function dothat(%s)" % self

A.dothis = dothat
b.dothis()




More information about the Python-list mailing list