Recently I managed to play around with Python again. The Python 3.0 (now I'm using 3.0.1) treats the print as an ordinary function.
Last time it is a special command:
print 'hello, world!'
which is treated as a different animal from any other Python functions. Now the Python 3.0 team has return print back to its mainstream:
The behavior of weird comma, a GW-BASIC-like print command also has been fixed here, we have to append a comma to tell Python interpreter not to print a new line character after a print command:
print "I don't want to skip to",
print "next line"
which will print (it adds space between the words "to" and "next line"):
I don't want to skip to next line
Sometimes, or most of the time, this behavior is considered weird. Of course it is not weird for a used-to-be-a-GW-BASIC/BASICA programmer like me. But for the rest of the world who only knows Pascal, C, Java, C++, etc it is a weird syntax!
Now Python 3.0 comes with the print as a normal Python function:
print("I don't want to skip to", end="")
which will print:
I don't want to skip tonext line
It's good to see that now some of the inconsistencies have been fixed. Of course it took a lot of consideration as they don't want to break the compatibility with previous versions. The 3.0 release is of course an exception. It was released as a breaking version, there will be some backward incompatibility with previous versions (2.x).