def creation_ordered(class_to_decorate):
    next_index = functools.partial(next, itertools.count())
    __init__orig = class_to_decorate.__init__
    @functools.wraps(__init__orig, assigned=['__doc__'])
    def __init__(self, *args, **kwargs):
        object.__setattr__(self, '_index', next_index())
        __init__orig(self, *args, **kwargs)
    setattr(class_to_decorate, '__init__', __init__)
    def __lt__(self, other):
        return self._index < other._index
    setattr(class_to_decorate, '__lt__', __lt__)
    class_to_decorate = functools.total_ordering(class_to_decorate)
    return class_to_decorate