On 09/05/07, Jim Jewett <[EMAIL PROTECTED]> wrote: > Maybe the tool has gotten smart enough to avoid constructions like: > > for k, v in list(dict.items()): > > for i in list(range(10)): > > but I can't help feeling there will always be a few cases where it > makes the code longer and worse.
Why don't you (in these cases) change your 2.x code to for k, v in dict.iteritems(): for i in xrange(10): Then 2to3 will do the right thing, *and* your 2.x code is improved... > knowing it will run OK in both versions. I will not be happy if I > have to do this editing more than once. If you edit the 2.6 source, you only need to do that once. Paul. _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com