IIRC there's a limited buffer used for the formatting. Also, if a dynamically created type name is 1000000 characters long I'd rather see it truncated than blow up my shell window.

On Friday, February 20, 2015, Eric V. Smith <eric@trueblade.com> wrote:
On 02/20/2015 09:05 AM, Brett Cannon wrote:
>     Some messages (only in C) truncate actual type name (%.50s, %.80s,
>     %.200s, %.500s). Should type name be truncated at all and for how limit?
>
>
> I assume this is over some worry of string size blowing out memory
> allocation or something? If someone can show that's an actual worry then
> fine, otherwise I say don't truncate.

I asked about this years ago, and was told it was in case the type name
pointer was bad, and to limit the amount of garbage printed. Whether
that's an actual problem or not, I can't say. It seems more likely that
you'd get a segfault, but maybe if it was pointing to reused memory it
could be useful.

Eric.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org


--
--Guido van Rossum (on iPad)