mirror of https://github.com/python/cpython.git
#868845: document <...> reprs.
This commit is contained in:
parent
bb89e686e3
commit
18f1914a02
|
@ -1004,11 +1004,15 @@ available. They are listed here in alphabetical order.
|
||||||
|
|
||||||
.. function:: repr(object)
|
.. function:: repr(object)
|
||||||
|
|
||||||
Return a string containing a printable representation of an object. This is the
|
Return a string containing a printable representation of an object. This is
|
||||||
same value yielded by conversions (reverse quotes). It is sometimes useful to be
|
the same value yielded by conversions (reverse quotes). It is sometimes
|
||||||
able to access this operation as an ordinary function. For many types, this
|
useful to be able to access this operation as an ordinary function. For many
|
||||||
function makes an attempt to return a string that would yield an object with the
|
types, this function makes an attempt to return a string that would yield an
|
||||||
same value when passed to :func:`eval`.
|
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)
|
.. function:: reversed(seq)
|
||||||
|
|
Loading…
Reference in New Issue