[Python-Dev] Re: Multibyte repr() (original) (raw)

Guido van Rossum guido@python.org
Thu, 10 Oct 2002 14:52:02 -0400


> > I realized that stringrepr's depending on locale can be a problem > > maker for many unexpected situations. What I wanted in this patch is > > just to see real string even in lists or dictionaries. > > I and CJKV users may feel happy even without stringrepr locale patch. > > I'm not sure I follow. What is the alternative that you propose?

I think Hye-Shik Chang would be happy if just tpprint acts according to the locale, and "most" containers support tpprint. Given that list, tuple, and dict have tpprint, no further action might be needed.

That should not be done. tp_print only gets invoked when sys.stdout is a real file; otherwise str() or repr() gets invoked. This should be transparent; tp_print should be an optimization only, not a way to get different semantics. It has already been mentioned that tp_print is not invoked when using print from IDLE.

I'm now convinced that having repr locale-specific is unacceptable. So I would back something out. However, I still sympathize with the original rationale, and I don't see a problem with tpprint differing from tprepr.

I do, see above. Feel free to back out the multibyte-string patches. We have learned something.

--Guido van Rossum (home page: http://www.python.org/~guido/)