allow POD to grab values off of similar objects

This commit is contained in:
Darren Ranalli 2005-06-16 19:43:25 +00:00
parent 9bf60050f6
commit 8b1aa5c90a

View File

@ -1173,7 +1173,12 @@ class POD:
# extract our dataset from an existing POD instance
obj = args[0]
for name in self.getDataNames():
setattr(self, name, getattr(obj, name))
# if the other obj doesn't have this data item, stick to the
# default
if hasattr(obj, name):
setattr(self, name, getattr(obj, name))
else:
setattr(self, name, self.getDefaultValue(name))
else:
assert len(args) == 0
if __debug__: