Operator Range

# Operator `Range`

Toolkits > com.ibm.streamsx.topology.pysamples 1.1.0 > com.ibm.streamsx.topology.pysamples.sources > Range

Callable: Range

## Python

    @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))

## Summary

Ports
  This operator has 0 input ports and 1 output port.
Windowing
  This operator does not accept any windowing configurations.
Parameters
  This operator supports 1 parameter.

  Required: count

Metrics
  This operator does not report any metrics.

## Properties

Implementation
  C++
Threading
  `Always` - Operator always provides a single threaded execution context.

Output Ports

Assignments
  This operator does not allow assignments to output attributes.

Ports (0)

  Properties
    - Optional: false
    - TupleMutationAllowed: true
    - WindowPunctuationOutputMode: Free

Parameters

This operator supports 1 parameter.

Required: count

`count`
  Properties
    - Type
    - Cardinality: 1
    - Optional: false
    - ExpressionMode: AttributeFree

Libraries

`SPLPY header`
  Include Path: `../../opt/.splpy/include`
`Python libraries.`
  Command: ../../opt/.splpy/common/pyversion3.sh