One of the benefits of print as a function is consistency. There is no reason for this statement. Compare these two lines
2.x: print >> my_file, x 3.x: print(x, file=my_file)
The new version is more like Python, isn't it?
Another advantage of the feature version is flexibility. For example, if you want to catch all print calls for debugging purposes, now you can simply override print :
def print(*args, **kwargs):
Sven Marnach Jun 04 2018-11-11T00: 00Z
source share