Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the '__lt__' magic method, thus providing the minimal set of rich comparison methods necessary to support sorting. This will allows users using these formatters for the more basic types (i.e. not dicts) to sort their output using the standard '--sort-column' option. Change-Id: I08e1f1bc75fa6452f19dfb9d221c1daec194d58d Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
- Loading branch information
1 parent
4f45f9a
commit c1c9910
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
releasenotes/notes/comparable-FormattableColumn-31c0030ced70b7fb.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
features: | ||
- | | ||
Instances of ``cliff.columns.FormattableColumn`` are now comparable. This | ||
allows implementations of ``FormattableColumn`` storing primitive data | ||
types or containers with primitive data types to be sorted using the | ||
``--sort-column`` option. Implementations of ``FormattableColumn`` that | ||
store other types of data will still need to implement their own rich | ||
comparison magic methods. |