bpo-14050: Note that not all data can be sorted (GH-15381) (GH-15395) · python/cpython@cb8de91 (original) (raw)

Original file line number Diff line number Diff line change
@@ -125,6 +125,13 @@ only modify the list have no return value printed -- they return the default
125 125 ``None``. [1]_ This is a design principle for all mutable data structures in
126 126 Python.
127 127
128 +Another thing you might notice is that not all data can be sorted or
129 +compared. For instance, ``[None, 'hello', 10]`` doesn't sort because
130 +integers can't be compared to strings and *None* can't be compared to
131 +other types. Also, there are some types that don't have a defined
132 +ordering relation. For example, ``3+4j < 5+7j`` isn't a valid
133 +comparison.
134 +
128 135
129 136 .. _tut-lists-as-stacks:
130 137