Again: Please hear my plea: print without softspace

Josiah Carlson jcarlson at nospam.uci.edu
Mon Mar 1 16:22:04 EST 2004


> I've wondered, though, whether there couldn't be a different 
> character instead of a ',' to alter the behavior of print. Maybe a 
> trailing '+' to indicate that what follows is to concatenate 
> directly. 
> 
> And yet I've been able to work around that little annoyance; it's not 
> that there is no way to format output the way you want.


It seems that you are saying:

print "hello ", "world" +   #-> "hello world"

That looks like "magic syntax", and should rightfully return a syntax 
error, because + already has a meaning for most all data types in 
Python.  Changing the behavior of print when a syntax error is present, 
is the wrong thing to do.

The right thing to do (if it were to happen at all) is to make 
fileobject.softspace "sticky" under some condition, perhaps after a call 
to fileobject.SetSoftSpace(False) (which doesn't currently exist).

  - Josiah



More information about the Python-list mailing list