chad wrote:
Let's say I have the following....

class BaseHandler:
    def foo(self):
        print "Hello"

class HomeHandler(BaseHandler):
    pass


Then I do the following...

test = HomeHandler()
test.foo()

How can HomeHandler call foo() when I never created an instance of
BaseHandler?

You don't need to create an instance of BaseHandler.  You have the
class, Python knows you have the class -- Python will look there if the
subclasses lack an attribute.

~Ethan~

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to