In article <[EMAIL PROTECTED]>,
 "Johny" <[EMAIL PROTECTED]> wrote:

> Where and when is good/nescessary to use `repr`  instead of `str` ?
> Can you please explain the differences

You expect repr to include information that you might call
`meta-data' or `type' -- object class and so forth.  To the
extent that this is of any interest, it's more or less equally
of interest with all objects.

If you go to the trouble to support str separately, it's a data
conversion and of course should render only the data.  An application
should be able to use str() to force data to string type (that's
what I mean by conversion.)  If the object can't sensibly be
converted to string type, then normally __str__ is omitted, and
defaults to __repr__.

   Donn Cave, [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to