def implied_by_holding(self, other: Holding, context: ContextRegister = None) -> bool: context = context or ContextRegister() return all( other.implies(self_holding, context=context.reversed()) for self_holding in self.holdings)
def implied_by_holding(self, other: Holding) -> Iterator[Explanation]: if all(other.implies(self_holding) for self_holding in self.holdings): yield Explanation( matches=[(other, self_holding) for self_holding in self.holdings], operation=operator.ge, )
def implied_by_holding( self, other: Holding, context: Optional[ContextRegister] = None ) -> Iterator[Explanation]: """Check if a Holding implies all the Holdings of self.""" if all( other.implies(self_holding, context=context) for self_holding in self.holdings ): yield Explanation( reasons=[(other, self_holding) for self_holding in self.holdings], operation=operator.ge, )
def _implied_by_holding(self, other: Holding, context: Explanation) -> bool: return all( other.implies(self_holding, context=context.reversed_context()) for self_holding in self.holdings)