On Sat, 22 Jul 2000, Paul Prescod wrote: > "Barry A. Warsaw" wrote: > > > > ... > > Because it's less readable. > > > > log.write('post to %s from %s, size=%d\n' % (listname, sender, len(msg))) > > > > vs > > > > print 'post to', listname, 'from', sender, 'size=', len(msg) > > Okay, how about > > log.writeln("Post to ", listname, " from ", sender, " size=", len( msg > )) Better yet, have writeln auto put spaces, and you have log.writeln("Post to", listname, "from", sender, "size=%s" % len(msg)) But I'm -0 on that, preferring a new sys function, called writeln writeln("......") writeln(file=logfile, "fffffff", "ffff") and of course writeln(nl=0, "ffffff") to simulate print "ffffff", That would be extremely readable, require no new syntax and no additional builtins. Reference implementation: def writeln(*args, **kw): import sys file = sys.stdout end = '\n' if kw.has_key("file"): file = kw['file'] del kw['file'] if kw.has_key("nl"): if not kw['nl']: end = ' ' del kw['nl'] file.write(" ".join(map(str, args))+end) -- Moshe Zadka <moshez@math.huji.ac.il> There is no GOD but Python, and HTTP is its prophet. http://advogato.org/person/moshez
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