On 09/23/12 18:52, Alec Taylor wrote:
> You can always use a counter if you don't like our fancy for-each loops;
> 
> foolist = [1,24,24,234,23,423,4]
> for i in xrange(len(foolist)):
>     print foolist[i]

http://www.seas.upenn.edu/~lignos/py_antipatterns.html

The first one on the list of anti-patterns is doing exactly this.
Just don't.  Ewww.  Inefficient, ugly, and harder to read.

Part of learning to write in Python is, well, learning to write
*Python*, not {C,C++,Java,PHP}-in-Python.

-tkc




-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to