"James Thornton" <ja...@jamesthornton.com> wrote
Why does user.params() not return all the params up the inheritance
chain? -- It's not including the params defined in Person() --
notice
Vertex() does not have a params() method.
class Element(object):
def params(self):
return dict(uuid=self.uuid, key=self.key)
class Vertex(Element):
class Person(Vertex):
def params(self):
params = dict(name=self.name,uri=self.uri,email=self.email)
params.update(self.s.params())
return params
class User(Person):
def params(self):
params = dict(first_name=self.first_name,
locale=self.locale)
print self.s.params()
params.update(self.s.params())
return params
Where does User.params call Person.params?
Or for that matter Person.params call its super class?
It doesn't happen automatically(thank goodness) you
have to do it explicitly.
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor