Yes. I could have just left it out, but I prefer to have a little
"custom" message instead of just "name does not exist" type messages.
Also, when you are looking at the class 'shape', you can find out what
methods you need to code to "complete" a basic shape.
> One bug:
>
> > import shape
> > cir = shape.circle(5)
> > ...
> > print cir.getarea() # print area of circle
>
> That prints a number close to 22.0, which would be right if pi were about
> 0.88 <wink>.
>
> The problem is in:
>
> class circle(shape):
> ...
> def getarea(self):
> return 3.14159 * (self.radius ^ 2)
>
> That's actually doing an xor on self.radius and 2. Clearest is probably
>
> from math import pi
> ...
> class circle(shape):
> ...
> def getarea(self):
> return pi * pow(self.radius, 2)
Thanks... sometimes I don't think things through 100% and I did not
test the code completely.
-- Lance Ellinghouse lance@fox.com