Fwd: Consider making enumerate a sequence if its argument is a sequence

30 Sep
2015
30 Sep
'15
8:22 p.m.
On Wed, Sep 30, 2015 at 11:28 AM, Neil Girdhar mistersheik@gmail.com wrote:
I found myself writing:
for vertex, height in zip( self.cache.height_to_vertex[height_slice], range(height_slice.start, height_slice.stop)):
I would have preferred:
for height, vertex in enumerate( self.cache.height_to_vertex)[height_slice]:
This does not seem to be an big improvement over
for height, vertex in enumerate( self.cache.height_to_vertex[height_slice], height_slice.start):
2804
Age (days ago)
2804
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexander Belopolsky