diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -71,7 +71,8 @@ .. method:: list.sort() :noindex: - Sort the items of the list, in place. + Sort the items of the list, in place. Each item needs to define an ordering + relationship. .. method:: list.reverse() @@ -99,6 +100,11 @@ >>> a.sort() >>> a [-1, 1, 66.25, 333, 333, 1234.5] + >>> a = ['abc', 3.14159, complex(1,-1), 123] + >>> a.sort() + Traceback (most recent call last): + File "", line 1, in + TypeError: no ordering relation is defined for complex numbers .. _tut-lists-as-stacks: