def __len__(self, pipe=None):
        """Return cardinality of the set."""
        pipe = self.redis if pipe is None else pipe
        return pipe.scard(self.key)
def __len__ ( self , pipe = None ) : pipe = self . redis if pipe is None else pipe return pipe . scard ( self . key )
Return cardinality of the set.