'Work out the range of the mapping from the given positions.
If no positions are specified, compute the range of the entire mapping.'

def range(self, positions=None):

    image = set()
    if (not self._index):
        self._build_index()
    if (not positions):
        positions = list(range(len(self._index)))
    for p in positions:
        image.update((f for (_, f) in self._index[p]))
    return sorted(image)
