gratuitous new features in 2.0

Toby Dickenson mbel44 at dial.pipex.net
Mon Oct 2 09:15:30 EDT 2000


"Alex Martelli" <alex at magenta.com> wrote:

>def pprint(*args, endline=1, tofile=sys.stdout):
>    if hasattr(tofile,'pprint'):
>        return tofile.pprint(*args,endline)
>    else:
>        tofile.write(string.join(map(str, args)))
>        if endline: tofile.write('\n')

The addition of Unicode strings prompted some discussion about using
that implementation strategy for the plain 'print' too, to allow
file-like objects to choose their own character encoding.


Toby Dickenson
tdickenson at geminidataloggers.com



More information about the Python-list mailing list