import logging


def key(name):
    """A key for sorting property names like function.property.index"""

    try:
        dot = name.rindex('.')
        return (name[:dot].lower(), int(name[dot+1:]))
    except ValueError:
        logging.warning("Property name not of the form STRING.INTEGER: %s",
                        name)
        return (name, 0)