Misleading wikipedia article on Python 3?

greg greg at cosc.canterbury.ac.nz
Fri Aug 10 04:28:52 EDT 2007


Evan Klitzke wrote:

> You can easily modify print in a safe way.

Yes, but you'd still have to replace the builtin print
function with your own to get it used by non-cooperative
code. That doesn't seem to gain you much over replacing
sys.stdout with something that intercepts and logs
stuff written to it.

 > What do you find wrong with this sort of "monkeypatching"?

At least sys.stdout was designed somewhat with the
possibility of replacing it in mind. It's not an
entirely unexpected thing to do. Replacing something
in the builtin namespace seems like a more drastic
step, somehow.

--
Greg



More information about the Python-list mailing list