aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--portage/util/iterate.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/portage/util/iterate.py b/portage/util/iterate.py
new file mode 100644
index 0000000..34ce894
--- /dev/null
+++ b/portage/util/iterate.py
@@ -0,0 +1,12 @@
+# Copyright: 2005 Gentoo Foundation
+# Author(s): Brian Harring (ferringb@gentoo.org)
+# License: GPL2
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/portage/util/iterate.py,v 1.1 2005/08/16 00:33:27 ferringb Exp $
+
+from itertools import islice
+
+def enumerate(iter, start, end):
+ count = start
+ for r in islice(iter, start, end):
+ yield count, r
+ count+=1