def zpartner(self): """ Property that returns the Z-partner of the given object if it exists, otherwise returns None. """ if self._mod == 12: zint = Z_PARTNERS.get(self.pcint, None) if zint: return self.copy(utils.fromint(zint)) else: return for each in self.each_card(): if each.icv == self.icv: if each.prime._unique_pcs != self.prime._unique_pcs: return self.copy(each)
def testZPartner(self): for each in self.make_z_sets(): self.assertTrue(each.zpartner.pcint in Z_PARTNERS.values())
def testZ(self): for each in self.make_z_sets(): each.z() self.assertTrue(each.pcint in Z_PARTNERS.values())
def make_z_sets(self): zints = Z_PARTNERS.keys() return [PCSet(utils.fromint(zint)) for zint in zints]