'Initialize with either a slice -- giving the equivalent page range,
or a PageRange object -- making a copy,
or a string like
"int", "[int]:[int]" or "[int]:[int]:[int]",
where the brackets indicate optional ints.
{page_range_help}
Note the difference between this notation and arguments to slice():
slice(3) means the first three pages;
PageRange("3") means the range of only the fourth page.
However PageRange(slice(3)) means the first three pages.'

def __init__(self, arg):

    if isinstance(arg, slice):
        self._slice = arg
        return
    if isinstance(arg, PageRange):
        self._slice = arg.to_slice()
        return
    m = (isString(arg) and re.match(PAGE_RANGE_RE, arg))
    if (not m):
        raise ParseError(arg)
    elif m.group(2):
        start = int(m.group(2))
        stop = ((start + 1) if (start != (-1)) else None)
        self._slice = slice(start, stop)
    else:
        self._slice = slice(*[(int(g) if g else None) for g in m.group(4, 6, 8)])
