diff -r f2e6c33ce3e9 Doc/tutorial/datastructures.rst --- a/Doc/tutorial/datastructures.rst Thu Jul 03 10:57:44 2014 -0500 +++ b/Doc/tutorial/datastructures.rst Fri Jul 04 14:34:42 2014 +0200 @@ -74,6 +74,12 @@ Sort the items of the list in place (the arguments can be used for sort customization, see :func:`sorted` for their explanation). + Each item needs to have an ordering relationship with the other items; + otherwise, :exc:`TypeError` is raised. An ordering relationship for + user-defined classes can be established by defining + :dfn:`rich comparison methods` like :meth:`__lt__` or the comparison method + :meth:`__cmp__`, both described in section :ref:`customization`. For details + on the ordering relationships of built-in types, see :ref:`comparisons`. .. method:: list.reverse() :noindex: