Serdar Tumgoren wrote:
<snip>


def result_of_SPECIALIZED_SQLcall_for_child():
    name =None
    return name

<snip>

class Child(Parent):
    def __init__(self):
        super(Child, self).__init__()

    def add_name(self):
        name = result_of_SPECIALIZED_SQLcall_for_child()
        try:
            name + ''
            self.name =ame
        except TypeError:
            #default to the superclass's add_name method
            super(Child, self).add_name()

Meantime, many thanks!!

I know this is a simplified example, but I'd still like to point out that using exceptions when there's a simple test is not reasonable. You can just check for None with a simple if test.

DaveA
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to