IsPython really O-O?

Andrew Dalke dalke at dalkescientific.com
Wed Nov 14 18:05:21 EST 2001


Me:
>>I wanted to add a new method, so I did
>>
>>class Spam:
>>  def double(self):
>>    self.x = self.x * 2

Daniel Klein:
>Just curious to know how it is that you expected this to work

Because I didn't think that 'class Spam' always created a new
class.  I thought it would reuse a definition of one already exists.
I believe this is similar to what Smalltalk does.

> why you were 'annoyed'?

Because it didn't fit my model of how the language worked, so
was more effort to learn.

>I can't
>see what the problem is with the double() method.

The problem was I wanted to add a method to an existing class.
The method definition was fine.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list