class BaseWithOrderedFields(type):
    """ Metaclass, which provides an attribute "ordered_fields", being an ordered
      list of class attributes that have a "creation_counter" attribute. """

def __new__(cls, name, bases, attrs):
    new_class = super(BaseWithOrderedFields, cls).__new__(cls, name, bases,
        attrs)
new_class._ordered_items = [(name, attrs.pop(name)) for name, obj in list(attrs.
    items()) if hasattr(obj, 'creation_counter')]
new_class._ordered_items.sort(key=lambda item: item[1].creation_counter)
return new_class
Как я могу получить поля в исходном порядке?