[Python-3000-checkins] r61872 - python/branches/py3k/Doc/library/functions.rst

georg.brandl python-3000-checkins at python.org
Tue Mar 25 08:21:32 CET 2008


Author: georg.brandl
Date: Tue Mar 25 08:21:32 2008
New Revision: 61872

Modified:
   python/branches/py3k/Doc/library/functions.rst
Log:
#868845: document <...> reprs.


Modified: python/branches/py3k/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k/Doc/library/functions.rst	(original)
+++ python/branches/py3k/Doc/library/functions.rst	Tue Mar 25 08:21:32 2008
@@ -1,4 +1,4 @@
-
+.. XXX document all delegations to __special__ methods
 .. _built-in-funcs:
 
 Built-in Functions
@@ -908,11 +908,13 @@
 
 .. function:: repr(object)
 
-   Return a string containing a printable representation of an object. This is the
-   same value yielded by conversions (reverse quotes). It is sometimes useful to be
-   able to access this operation as an ordinary function.  For many types, this
-   function makes an attempt to return a string that would yield an object with the
-   same value when passed to :func:`eval`.
+   Return a string containing a printable representation of an object.  For many
+   types, this function makes an attempt to return a string that would yield an
+   object with the same value when passed to :func:`eval`, otherwise the
+   representation is a string enclosed in angle brackets that contains the name
+   of the type of the object together with additional information often
+   including the name and address of the object.  A class can control what this
+   function returns for its instances by defining a :meth:`__repr__` method.
 
 
 .. function:: reversed(seq)


More information about the Python-3000-checkins mailing list