prove that all attributes are defined appropriately

def _validateAttrs(self, keys):
        """prove that all attributes are defined appropriately"""
        badAttrs = []
        for k in keys:
            if k not in self.__dict__:
                badAttrs.append("Attribute key '%s' is not a valid attribute"%(k))
        badAttrsMsg = os.linesep.join(badAttrs)
        if not keys: return # is iterable, but didn't contain any keys
        if badAttrsMsg:
            raise ValueError("Encountered invalid attributes.  ALLOWED: %s%s%s"\
                %(list(self.__dict__), os.linesep, badAttrsMsg))