diff -r 3ae2cd85a908 Doc/library/functions.rst --- a/Doc/library/functions.rst Sun Mar 09 11:18:16 2014 +0100 +++ b/Doc/library/functions.rst Sat Mar 15 14:17:57 2014 -0400 @@ -617,9 +617,19 @@ .. function:: hex(x) - Convert an integer number to a hexadecimal string. The result is a valid Python - expression. If *x* is not a Python :class:`int` object, it has to define an - :meth:`__index__` method that returns an integer. + Convert an integer number to a lowercase hexadecimal string + prefixed with "0x", for example: + + >>> hex(255) + '0xff' + >>> hex(-42) + '-0x2a' + + If x is not a Python `int` object, it has to define an __index__() + method that returns an integer. + + See also :func:`int` for converting a hexadecimal string to an + integer using a base of 16. .. note::