Range of ordinal numbers My disgusting list comprehension in the return statement is quite a headful.

"""Hopefully this function will save you the trip to oocalc/excel.

"""

def rangeth(start, stop=None, skip=1):
    """rangeth([start,] stop[, skip])

returns a list of strings as places in a list (1st, 2nd, etc)

&gt;&gt;&gt; rangeth(4)
['0th', '1st', '2nd', '3rd']

    """

    if stop is None:
        stop, start = start, 0

    places = {'1':'st', '2':'nd', '3':'rd'}

    return ["{}{}".format(i, places.get(i[-1], 'th')) \
            if i[-2:] not in ['11', '12', '13'] else "{}{}".format(i, 'th') \
            for i in map(str, range(start, stop, skip))]


Also, can someone explain to me how range accepts it's parameters? I have my ugly little boilerplate here that I wish didn't exist. I can't find the source for range, as I gave up after thinking it's probably some header file in include.
Firstly, I'd suggest not duplicating the overloading logic of range. Instead:

def rangeth(*args):
    print range(*args)


Just take your arguments and pass them onto to range. 

Secondly, I'd write a function that takes a single number and produces the "th"ified version.

def as_th(number):
    number = str(number)
    if number[-2:] in ['11','12','13]:
         return "{}{}".format(number, 'th')
    else:
         return "{}{}".format(number, places.get(number[-1], 'th'))


I think that makes it easier to follow.

Then have you rangeth function be:

def rangeth(*args):
    return map(as_th, range(*args))