def _sublist(items, starting_value, ending_value=None):
        """
        >>> list(Query._sublist((x*x for x in range(1, 100)), 16, 64))
        [16, 25, 36, 49, 64]
        """
        have_started = starting_value is None

        for x in items:
            have_started = have_started or x == starting_value
            if have_started:
                yield x

            if ending_value is not None and x == ending_value:
                break
>>> list(Query._sublist((x*x for x in range(1, 100)), 16, 64))
        [16, 25, 36, 49, 64]