FieldList.sort(key=None, reverse=False)[source]

Sort of the list in place.

By default the list is sorted by the identities of its constructs, but any sort criteria can be specified with the key parameter.

The sort is stable.

New in version 1.0.4.

See also


key: function, optional

Specify a function of one argument that is used to extract a comparison key from each construct. By default the list is sorted by construct identity, i.e. the default value of key is lambda x: x.identity().

reverse: bool, optional

If set to True, then the list elements are sorted as if each comparison were reversed.