summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-08-22 16:39:52 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-22 16:39:52 (GMT)
commitcb8de91dadf15925fb95069cb190398e1d485f56 (patch)
tree79ea0c0e4157bff40303c975aa237f3e5788cebb /Doc/tutorial
parent2878f378e02990303a8fe4bedd5386bd90efc26d (diff)
downloadcpython-cb8de91dadf15925fb95069cb190398e1d485f56.zip
cpython-cb8de91dadf15925fb95069cb190398e1d485f56.tar.gz
cpython-cb8de91dadf15925fb95069cb190398e1d485f56.tar.bz2
bpo-14050: Note that not all data can be sorted (GH-15381) (GH-15395)
(cherry picked from commit 4109263a7edce11194e301138cf66fa2d07f7ce4) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/datastructures.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 01e437b..a0d5627 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -125,6 +125,13 @@ only modify the list have no return value printed -- they return the default
``None``. [1]_ This is a design principle for all mutable data structures in
Python.
+Another thing you might notice is that not all data can be sorted or
+compared. For instance, ``[None, 'hello', 10]`` doesn't sort because
+integers can't be compared to strings and *None* can't be compared to
+other types. Also, there are some types that don't have a defined
+ordering relation. For example, ``3+4j < 5+7j`` isn't a valid
+comparison.
+
.. _tut-lists-as-stacks: