'Return list of methods within a class sorted by lineno.'

def listmethods(self):

    if (not self.cl):
        return []
    items = []
    for (name, lineno) in self.cl.methods.items():
        items.append((lineno, name))
    items.sort()
    list = []
    for (item, name) in items:
        list.append(name)
    return list
