[Python-ideas] Fwd: Re: Unambiguous repr for recursive objects
Guido van Rossum
guido at python.org
Sat Dec 26 12:15:43 EST 2015
Well, that is not the point of the repr() guideline. It is so you can
understand what value you got. There are plenty of other cases where eval()
of the repr silently gives something different, e.g. when the same object
occurs multiple times. Neither proposal is clearer to understand.
--Guido (mobile)
On Dec 26, 2015 9:59 AM, "Serhiy Storchaka" <storchaka at gmail.com> wrote:
> I disagree. We should not take this guideline too literally. The dots
>> are easily understood and nobody has been fooled by a list containing an
>> ellipsis yet. (Also, isn't the repr of an ellipsis the string 'Ellipsis'?)
>>
>
> Yes, the repr of an ellipsis is the string 'Ellipsis'. But the repr of
> recursive list still looks as Python expression, and if somebody uses
> repr/eval wraparound, he will silently get wrong result instead of an error.
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151226/1d4284a4/attachment.html>
More information about the Python-ideas
mailing list