[Python-checkins] r66650 - sandbox/trunk/2to3/lib2to3/refactor.py

benjamin.peterson python-checkins at python.org
Sat Sep 27 21:22:21 CEST 2008


Author: benjamin.peterson
Date: Sat Sep 27 21:22:21 2008
New Revision: 66650
Log:
make use of enumerate
Modified:
 sandbox/trunk/2to3/lib2to3/refactor.py
Modified: sandbox/trunk/2to3/lib2to3/refactor.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/refactor.py	(original)
+++ sandbox/trunk/2to3/lib2to3/refactor.py	Sat Sep 27 21:22:21 2008
@@ -403,9 +403,7 @@
 block = None
 block_lineno = None
 indent = None
- lineno = 0
- for line in input.splitlines(True):
- lineno += 1
+ for lineno, line in enumerate(input.splitlines(True)):
 if line.lstrip().startswith(self.PS1):
 if block is not None:
 result.extend(self.refactor_doctest(block, block_lineno,


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /