def evens_first(nums):
    """Solution to exercise C-4.19.

    Write a short recursive Python function that rearranges a sequence of
    integer values so that all the even values appear before all the odd
    values.
    """
    n = len(nums)

    def recurse(start, stop):
        if start == stop:
            return nums  # Base case, finished sorting list
        if nums[start] % 2 == 0:
            return recurse(start+1, stop)
        nums[stop], nums[start] = nums[start], nums[stop]
        return recurse(start, stop-1)

    return recurse(0, n-1)