Same issue applies as in __iter__, this is a filtered view over the parent map.

> On May 20, 2014, at 5:46 PM, Brett Hazen <notifications@github.com> wrote:
> 
> In riak/datatypes/map.py:
> 
> > +    def __init__(self, parent, datatype):
> > +        self.map = parent
> > +        self.datatype = datatype
> > +
> > +    # Mapping API
> > +    def __getitem__(self, key):
> > +        return self.map[(key, self.datatype)]
> > +
> > +    def __iter__(self):
> > +        for key in self.map.value:
> > +            name, datatype = key
> > +            if datatype == self.datatype:
> > +                yield self.map[key]
> > +
> > +    def __len__(self):
> > +        return len(iter(self))
> Would len(self.map.value) be more efficient? I'm assuming iter calls the above iterator.
> 
> —
> Reply to this email directly or view it on GitHub.