]> granicus.if.org Git - python/commitdiff
#868845: document <...> reprs.
authorGeorg Brandl <georg@python.org>
Tue, 25 Mar 2008 07:20:15 +0000 (07:20 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 25 Mar 2008 07:20:15 +0000 (07:20 +0000)
Doc/library/functions.rst

index e54c6e2f32f627f4b120ed9bbf34c2bcdec05798..e9664959b129f8d4681b1ad20e49719a052b3f55 100644 (file)
@@ -1004,11 +1004,15 @@ available.  They are listed here in alphabetical order.
 
 .. 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.  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`, 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)