Skip to content

bpo-14050: Note that not all data can be sorted #15381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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