MCPcopy Create free account
hub / github.com/ActiveState/code / __and__

Method __and__

recipes/Python/574428_Container/recipe-574428.py:28–34  ·  view source on GitHub ↗
(self,other)

Source from the content-addressed store, hash-verified

26 def __len__(self): # Container length
27 return len(self.switch)
28 def __and__(self,other): # Intersection
29 self.intersect = operator.and_
30 res = []
31 for item in self.switch:
32 if item in other:
33 res.append(item)
34 return Container(res)
35 def __or__(self,other): # Union
36 self.union = operator.or_
37 res = self.value[:]

Callers

nothing calls this directly

Calls 2

ContainerClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected