[Python-3000] print() parameters in py3k

Jim Jewett jimjjewett at gmail.com
Mon Nov 20 20:05:21 CET 2006


On 11/19/06, Guido van Rossum <guido at python.org> wrote:
> On 11/19/06, Georg Brandl <g.brandl at gmx.net> wrote:
> > Guido van Rossum wrote:

> > > 2. A keyword parameter will direct it to a different file.
> > > Probably print(x, y, z, file=<file-like object>).

> > > 3. Two more keyword parameters can change what gets inserted between
> > > items and at the end.
> > > Perhaps print(x, y, z, sep=<string>, end=<string>). These default to "
> > > " and "\n", respectively.

> A PEP may also discourage attempts to add more cruft,

(1)  Is this an explicit rejection of a keyword for a format string, such as

    print (x, y, z, fmt="My X: %s, Your Y: %s, His Z: %s")

(2)  What happens to additional keyword arguments that do get passed?
    (a)  A StandardError of some sort is raised.
    (b)  print is treated as though it had (but ignored) a **kwargs
argument, to support extensions in print-replacements.
    (c)  The extra arguments are printed at the end, perhaps with a label.

-jJ


More information about the Python-3000 mailing list