[Python-Dev] Removing the implicit str() call from printing API

Guido van Rossum guido@digicool.com
Sat, 10 Feb 2001 14:49:34 -0500


> Ok, I'll postpone this for 2.2 then... don't want to disappoint
> our BDFL ;-)

The alternative would be for you to summarize why the proposed change
can't possibly break code, this late in the 2.1 release game. :-)

> Perhaps we should rethink the whole complicated printing machinery
> in Python for 2.2 and come up with a more generic solution to the
> problem of letting to-be-printed objects pass through to the
> stream objects ?!

Yes, please!  I'd love it if you could write up a PEP that analyzes
the issues and proposes a solution.  (Without an analysis of the
issues, there's not much point in proposing a solution, IMO.)

> Note that this is needed in order to be able to redirect sys.stdout
> to a codec which then converts Unicode to some external encoding.
> Currently this is not possible due to the implicit str() call in
> PyObject_Print().

Excellent.  I agree that it's a shame that Unicode I/O is so hard at
the moment.

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