[Numpy-svn] r8229 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 21:22:16 CST 2010


Author: charris
Date: 2010-02-20 21:22:16 -0600 (Sat, 20 Feb 2010)
New Revision: 8229

Modified:
   trunk/numpy/lib/recfunctions.py
Log:
STY: Use explicit itertools namespace for all itertools functions.

Modified: trunk/numpy/lib/recfunctions.py
===================================================================
--- trunk/numpy/lib/recfunctions.py	2010-02-21 03:21:22 UTC (rev 8228)
+++ trunk/numpy/lib/recfunctions.py	2010-02-21 03:22:16 UTC (rev 8229)
@@ -11,8 +11,6 @@
 import itertools
 import numpy as np
 import numpy.ma as ma
-from itertools import chain as iterchain
-from itertools import repeat as iterrepeat
 from numpy import ndarray, recarray
 from numpy.ma import MaskedArray
 from numpy.ma.mrecords import MaskedRecords
@@ -280,8 +278,8 @@
         "Yields the fill_value or raises IndexError"
         yield counter()
     #
-    fillers = iterrepeat(fill_value)
-    iters = [iterchain(it, sentinel(), fillers) for it in seqarrays]
+    fillers = itertools.repeat(fill_value)
+    iters = [itertools.chain(it, sentinel(), fillers) for it in seqarrays]
     # Should we flatten the items, or just use a nested approach
     if flatten:
         zipfunc = _izip_fields_flat
@@ -414,8 +412,8 @@
         else:
             fmsk = True
         nbmissing = (maxlength-len(a))
-        seqdata[i] = iterchain(a, [fval]*nbmissing)
-        seqmask[i] = iterchain(m, [fmsk]*nbmissing)
+        seqdata[i] = itertools.chain(a, [fval]*nbmissing)
+        seqmask[i] = itertools.chain(m, [fmsk]*nbmissing)
     #
     data = izip_records(seqdata, flatten=flatten)
     data = tuple(data)



More information about the Numpy-svn mailing list