Possibly a stupid question regarding Python Classes
Terry Reedy
tjreedy at udel.edu
Sun Nov 17 11:57:25 EST 2002
"Adonis" <deltapigz at telocity.com> wrote in message
news:3dd7c140$1_6 at nopics.sjc...
> Is this even possible:
>
> class Foo:
> def Bar(self):
> print 'Foo'
>
> class Fib(Foo):
> def Bar(self):
> # do the original Foo.Bar()
go ahead and do it...
Foo.Bar(self)
> # NOTE: w/o needing to instantiate Foo
the instance of Fib effectively *is* an instance of Foo
> # then do:
> print 'Bar'
Terry J. Reedy
More information about the Python-list
mailing list