from typing import List


def _range_slice(s: slice, endpoint: bool = True) -> List[int]:
    """
    Create a list of integers as specified by the slice.

    Parameters
    ----------
    s : slice
    endpoint : bool

    Returns
    -------
    slice_indices : list of int

    Examples
    --------
    >>> _range_slice(slice(200, 500, 50))
    [200,
     250,
     300,
     350,
     400,
     450,
     500]
    """
    # If the caller wants the right endpoint to be included, adjust
    # the 'stop' value by 1 (or -1) so the .indices() method includes it.
    if endpoint:
        adjust = 1 if s.step >= 0 else -1
        s = slice(s.start, s.stop + adjust, s.step)
    return list(range(*(s.indices(s.stop))))