def rec_cmp_prereleases(one, two):
    """Recursive function that compares two version strings represented as lists
    to determine which takes precedence.  If it is the left argument ("one"), the 
    result will be a 1.  If the righthand argument wins ("two"), the result will be
    a 2.  If the two are equivalent (i.e. are the same string), the result is a 0.

    :param one: left-hand version str
    :param two: right-hand version str
    :return: 0, 1, or 2
    :rtype: int
    """
    if one == two:
        return 0

    # if either has reached its zenith of productivity, the other has won.
    #
    # (Note that this is only correct in the context of there being conditionals in
    #  the cmp_prerelease function that already handle the case in which one 
    #  version string has a prerelease and the other one doesn't!  This recursive
    #  comparator function won't ever be invoked in that situation.) 
    if len(one) == 0:
        return 2
    elif len(two) == 0:
        return 1

    # ok so we still have two values to compare.
    # try to make ints; if we fail, then we have ASCII.
    cmp_strs = {}
    cmp_ints = {}
    try:
        cmp_ints[1] = int(one[0])
    except ValueError:
        cmp_strs[1] = one[0]

    try:
        cmp_ints[2] = int(two[0])
    except ValueError:
        cmp_strs[2] = two[0]

    if len(cmp_strs)==2:
        # if the two strings are equivalent, recurse down further.
        # if not, declare a winner by ASCII value.
        if cmp_strs[1] == cmp_strs[2]:
            return rec_cmp_prereleases(one[1:], two[1:])
        elif cmp_strs[1] > cmp_strs[2]:
            return 1
        elif cmp_strs[1] < cmp_strs[2]:
            return 2

    elif len(cmp_ints)==2:
        # if the two integers are equivalent, recurse down further.
        # otherwise, declare a winner by integer value. 
        if cmp_ints[1] == cmp_ints[2]:
            return rec_cmp_prereleases(one[1:], two[1:])
        elif cmp_ints[1] > cmp_ints[2]:
            return 1
        elif cmp_ints[1] < cmp_ints[2]:
            return 2

    # Apples and oranges: ASCII always wins.
    return list(cmp_strs.keys())[0]