bpo-14050: Note that not all data can be sorted (GH-15381)

This commit is contained in:
Raymond Hettinger 2019-08-22 09:11:35 -07:00 committed by GitHub
parent a38e9d1399
commit 4109263a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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 ``None``. [1]_ This is a design principle for all mutable data structures in
Python. 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: .. _tut-lists-as-stacks: