1.1 --- a/micropython/data.py Sun Aug 17 02:58:28 2008 +0200
1.2 +++ b/micropython/data.py Sun Aug 17 20:46:49 2008 +0200
1.3 @@ -280,8 +280,8 @@
1.4
1.5 return isinstance(self.parent, Class) and isinstance(self.context, Class) and (
1.6 self.context is self.parent or
1.7 - self.context in self.parent.descendants or
1.8 - self.parent in self.context.descendants)
1.9 + self.context.has_subclass(self.parent) or
1.10 + self.parent.has_subclass(self.context))
1.11
1.12 def __repr__(self):
1.13 return "Attr(%r, %s, %s, %r, %s, %r)" % (
1.14 @@ -450,6 +450,9 @@
1.15 for base in self.bases:
1.16 base.add_descendant(cls)
1.17
1.18 + def has_subclass(self, other):
1.19 + return other in self.descendants
1.20 +
1.21 "Return the attribute names provided by this class only."
1.22
1.23 class_attribute_names = NamespaceDict.keys