A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/007190.html below:

[Python-Dev] extended print statement, uPre-PEP

[Python-Dev] extended print statement, uPre-PEPBarry A. Warsaw bwarsaw@beopen.com
Sun, 23 Jul 2000 23:01:42 -0400 (EDT)
>>>>> "MZ" == Moshe Zadka <moshez@math.huji.ac.il> writes:

    MZ> But I'm -0 on that, preferring a new sys function, called
    MZ> writeln

    MZ> That would be extremely readable, require no new syntax and no
    MZ> additional builtins.

    MZ> Reference implementation:

Add a `sep' keyword, check for residual keyword arguments, and I might
be +0 on that.  Of course, now you're in the realm of...

so-easy-i'll-just-cut-and-paste-this-into-my-own-app-ly y'rs,
-Barry

-------------------- snip snip --------------------
def writeln(*args, **kws):
    import sys
    file = sys.stdout
    sep = ' '
    end = '\n'
    if kws.has_key('file'):
        file = kws['file']
        del kws['file']
    if kws.has_key('nl'):
        if not kws['nl']:
            end = ' '
        del kws['nl']
    if kws.has_key('sep'):
        sep = kws['sep']
        del kws['sep']
    if kws:
        raise TypeError('unexpected keywords')
    file.write(sep.join(map(str, args)) + end)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4