Esempio 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)
Esempio 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,
         )
Esempio 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,
         )
Esempio 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)