Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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,
         )
Ejemplo n.º 3
0
 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,
         )
Ejemplo n.º 4
0
 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)