KraftDiner wrote:
> Well here is a rough sketch of my code...
> This is giving my two problems.
>
> 1) TypeError: super() argument 1 must be type, not classobj
> 2) I want to be sure the the draw code calls the inherited classes
> outline and not its own...
>
> class Shape:
> def __init__(
KraftDiner wrote:
> This is what I've got so far:
> class Rect(Shape):
> def __init__(self):
> super(self.__class__, self).__init__()
Should be
super(Rect, self).__init__()
> def render(self):
> super(self.__class__, self).render()
ditto
In this exampl
KraftDiner <[EMAIL PROTECTED]> wrote:
> Well here is a rough sketch of my code...
> This is giving my two problems.
>
> 1) TypeError: super() argument 1 must be type, not classobj
Make your classes new-style (have Shape inherit from object) to fix
this. You're using the legacy (old-style) objec
This is what I've got so far:
class Shape(object):
def __init__(self):
pass
def render(self):
print 'Shape render'
self.outline()
def outline(self):
pass
class Rect(Shape):
def __init__(self):
Well here is a rough sketch of my code...
This is giving my two problems.
1) TypeError: super() argument 1 must be type, not classobj
2) I want to be sure the the draw code calls the inherited classes
outline and not its own...
class Shape:
def __init__(self):
pass
KraftDiner wrote:
> I have a base class called Shape
> And then classes like Circle, Square, Triangle etc, that inherit from
> Shape:
>
> My quesiton is can a method of the Shape class call a method in Circle,
> or Square etc...?
This looks familiar. :-)
Yes, it can if it has references to the
"KraftDiner" <[EMAIL PROTECTED]> writes:
> I have a base class called Shape
> And then classes like Circle, Square, Triangle etc, that inherit from
> Shape:
>
> My quesiton is can a method of the Shape class call a method in Circle,
> or Square etc...?
Yup:
>>> class Shape(object):
... def comm
Hi,
22 Oct 2005 14:40:09 -0700, KraftDiner <[EMAIL PROTECTED]>:
> I have a base class called Shape
> And then classes like Circle, Square, Triangle etc, that inherit from
> Shape:
>
> My quesiton is can a method of the Shape class call a method in Circle,
> or Square etc...?
even there would exis