Did I find the right examples for you? yes no

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)
Only consier list and iterator (with __iter__ and next) iterable
for other value, turn it to a iterator with only one item

        def makeiter(src):
    """
    Only consier list and iterator (with __iter__ and next) iterable
    for other value, turn it to a iterator with only one item
    """
    if hasattr(src, '__iter__') and hasattr(src, 'next'):
        return src
    elif isinstance(src, list):
        return iter(src)
    else:
        return iter([src])
        


src/s/o/solo-HEAD/bak/dset.py   solo(Download)
    def perform(self, value):
        it = util.makeiter(value)
        return itertools.imap(self.func, it)
DSet.operator('map', Map)
 
    def perform(self, value):
        it = util.makeiter(value)
        return itertools.ifilter(self.filter_func, it)
DSet.operator('filter', Filter)
 
    def perform(self, value):
        it = util.makeiter(value)
        return itertools.islice(it, self.start, self.stop, self.step)
DSet.operator('limit', Limit)
DSet.operator('__getslice__', Limit)
    def perform(self, value):
        it = util.makeiter(value)
        output = {}
        for item in it:
            key = self.keyfunc(item)
    def perform(self, value):
        it = util.makeiter(value)
        for x in it:
            for y in self.other:
                yield (x, y)

src/s/o/solo-HEAD/bak/tpl.py   solo(Download)
    def __call__(self, src):
        it = util.makeiter(self.withpat(src))
        return map(self.do, it)        
 
class CaseTemplate(_Template):