def range(self, step):
if self.__compare_timedelta(step, <NUM_LIT:0>) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>is_inversion = False<EOL>try:<EOL><INDENT>self.validate_time_inversion()<EOL><DEDENT>except ValueError:<EOL><INDENT>is_inversion = True<EOL><DEDENT>if not is_inversion:<EOL><INDENT>if self.__compare_timedelta(step, seconds=<NUM_LIT:0>) < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>".format(step))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if self.__compare_timedelta(step, seconds=<NUM_LIT:0>) > <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>".format(step))<EOL><DEDENT><DEDENT>current_datetime = self.start_datetime<EOL>while current_datetime <= self.end_datetime:<EOL><INDENT>yield current_datetime<EOL>current_datetime = current_datetime + step<EOL><DEDENT>
Return an iterator object.

:param step: Step of iteration.
:type step: |timedelta|/dateutil.relativedelta.relativedelta
:return: iterator
:rtype: iterator

:Sample Code:
    .. code:: python

        import datetime
        from datetimerange import DateTimeRange

        time_range = DateTimeRange("2015-01-01T00:00:00+0900", "2015-01-04T00:00:00+0900")
        for value in time_range.range(datetime.timedelta(days=1)):
            print(value)
:Output:
    .. parsed-literal::

        2015-01-01 00:00:00+09:00
        2015-01-02 00:00:00+09:00
        2015-01-03 00:00:00+09:00
        2015-01-04 00:00:00+09:00