def Valid(self):
        """Returns whether the iterator is valid or not

        @rtype: bool
        """
        valid = self._impl.Valid()
        if not valid or self._prefix is None:
            return valid
        key = self._impl.key()
        return key[:len(self._prefix)] == self._prefix
Returns whether the iterator is valid or not

        @rtype: bool
        
pymclevel/leveldb.py