def split_numalpha(s):
    """Converts a string into a list of alternating string and
    integers. This makes it possible to sort a list of strings
    numerically even though they might not be fully convertable to
    integers

    >>> split_numalpha('10 a §') == ['', 10, ' a §']
    True
    >>> split_numalpha("squared²") == ["squared²"]
    True
    >>> sorted(['2 §', '10 §', '1 §'], key=split_numalpha) == ['1 §', '2 §', '10 §']
    True
    """
    assert isinstance(s, str), "%s is a %s, not a (unicode) string" % (s, str(type(s)))
    res = []
    seg = ''
    if not s:
        return res
    digit = s[0].isdecimal()
    for c in s:
        if (c.isdecimal() and digit) or (not c.isdecimal() and not digit):
            seg += c
        else:
            res.append(int(seg) if seg.isdecimal() else seg)
            seg = c
            digit = not digit
    res.append(int(seg) if seg.isdecimal() else seg)
    if isinstance(res[0], int):
        res.insert(0, '')  # to make sure every list has type str,int,str,int....
    return res