summaryrefslogtreecommitdiff
path: root/releasenotes/notes
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2021-01-28 11:34:44 +0000
committerStephen Finucane <sfinucan@redhat.com>2021-01-29 15:40:42 +0000
commitc1c991045cece85dd55494f9d4670429e370e131 (patch)
tree7cefcabd9326a6f8a42edc0eb061d808ffca4ff8 /releasenotes/notes
parent4f45f9a30e657265c5b5ac119af3aaa0e5ec7184 (diff)
downloadcliff-c1c991045cece85dd55494f9d4670429e370e131.tar.gz
Make 'FormattableColumn' comparable
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>
Diffstat (limited to 'releasenotes/notes')
-rw-r--r--releasenotes/notes/comparable-FormattableColumn-31c0030ced70b7fb.yaml9
1 files changed, 9 insertions, 0 deletions
diff --git a/releasenotes/notes/comparable-FormattableColumn-31c0030ced70b7fb.yaml b/releasenotes/notes/comparable-FormattableColumn-31c0030ced70b7fb.yaml
new file mode 100644
index 0000000..f32322e
--- /dev/null
+++ b/releasenotes/notes/comparable-FormattableColumn-31c0030ced70b7fb.yaml
@@ -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.