[Tutor] empty class methods

david din22 at earthlink.net
Wed Dec 14 12:39:58 CET 2005



class foo:
    def sayhi(self):
        print 'hello world'
    def saybye(self): ##is there any reason for this to be here?
        pass

class bar(foo):
    def saybye(self):
        print 'bye now'

class baz(foo):
    def saybye(self):
        print 'later tater'

x = foo()
y = bar()
z = baz()

x.sayhi()
y.sayhi()
y.saybye()
z.sayhi()
z.saybye()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20051214/39b5328e/attachment.html


More information about the Tutor mailing list