Skip to content

Commit

Permalink
bpo-14050: Note that not all data can be sorted (pythonGH-15381)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhettinger authored Aug 22, 2019
1 parent a38e9d1 commit 4109263
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Doc/tutorial/datastructures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 4109263

Please sign in to comment.