I think it'd be good to write a sanity check before this block: if not hasattr(cls, "PERSISTENCY_MAP"): complain ...