On 2008-12-10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

> I think this combination might do the trick (I don't have 2.6 to test
> it right now):

> from __future__ import print_function
> from __future__ import unicode_literals
> from functools import partial
> import io
> print = partial(print, sep=" ", end="\n")
> out = io.StringIO()
> print("hello", file=out)

The example works, but unicode_literals causes problems elsewhere, in optparse
for example. I didn't look into it too closely. I'll probably give up trying
to anticipate 3.0 with 2.6 too closely.

-Bill
-- 
Sattre Press                                      Tales of War
http://sattre-press.com/                       by Lord Dunsany
[EMAIL PROTECTED]         http://sattre-press.com/tow.html
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to