On Sat, 26 Jun 2010 17:02:32 -0700, Paul Rubin wrote: > Terry Reedy <tjre...@udel.edu> writes: >> Having completely switched from 'printf(' to 'print ', I have had a bit >> of a problem switching back to 'print('. It is my single largest source >> of typos. But a decent system that puts me at the site of syntax errors >> alleviates this. Logic bugs are a much bigger problem. > > I tend to print a lot of tracing messages in my programs, in the form > > print (x, y, z) > > expecting to print the tuple (x,y,z) in a form that I can read back into > an analysis program. That's going to break without throwing any syntax > errors if I ever switch to Python 3.
Apart from retraining yourself to add the extra parentheses, the easy fix is to put this at the top of your module: _pr = print def print(*args, **kwargs): _pr(args, **kwargs) But I'm sure you know this :) I didn't notice this level of angst when Python made equally significant changes going from 1.5 to 2.0... admittedly Python 1.5 code would work unchanged in 2.0, but the 2.x series introduced MUCH bigger additions to Python than anything 3.0 and 3.1 have added, and anyone taking advantage of those changes is implicitly writing code which is not backwards compatible. To all the Python 3.x haters -- spend a few minutes installing Python 1.5 and playing around with it and see how much it is missing: no integrated help, no unicode, no __futures__, no generators, no iterators apart from xrange and xreadlines, no properties... See how long you last before you (metaphorically) throw it across the room in disgust. That's what you'll be like for Python 2.x in a decade. I realise it's hard to see that now, when so many major libraries haven't been ported yet and the unicode vs. bytes situation is still unclean, but 3.x is the future of Python, and a good thing it is too. -- Steven -- http://mail.python.org/mailman/listinfo/python-list