Toolkits > com.ibm.streamsx.topology.pysamples 1.1.0 > com.ibm.streamsx.topology.pysamples.sources > Range
Callable: Range
@spl.source()
class Range(object):
def __init__(self, count):
self.count = count
def __iter__(self):
# Use zip to convert the single returned value
# into a tuple to allow it to be returned to SPL
if sys.version_info.major == 2:
# zip behaviour differs on Python 2.7
return iter(zip(range(self.count)))
return zip(range(self.count))
Required: count
Required: count