# Buggy code
def __new__(
    cls,
    start=None,
    end=None,
    periods=None,
    offset=datetools.bday,
    time_rule=None,
    tzinfo=None,
    name=None,
    **kwds,
):
    time_rule = kwds.get("timeRule", time_rule)
    if time_rule is not None:
        offset = datetools.getOffset(time_rule)

    if time_rule is None:
        if offset in datetools._offsetNames:
            time_rule = datetools._offsetNames[offset]

    # Cachable
    if not start:
        start = kwds.get("begin")
    if not periods:
        periods = kwds.get("nPeriods")

    start = datetools.to_datetime(start)
    end = datetools.to_datetime(end)

    if start is not None and not isinstance(start, datetime):
        raise ValueError("Failed to convert %s to datetime" % start)

    if end is not None and not isinstance(end, datetime):
        raise ValueError("Failed to convert %s to datetime" % end)

    # inside cache range. Handle UTC case
    useCache = _will_use_cache(offset)

    start, end, tzinfo = _figure_out_timezone(start, end, tzinfo)
    useCache = useCache and _naive_in_cache_range(start, end)

    if useCache:
        index = cls._cached_range(
            start, end, periods=periods, offset=offset, time_rule=time_rule, name=name
        )
        if tzinfo is None:
            return index
    else:
        xdr = generate_range(
            start=start, end=end, periods=periods, offset=offset, time_rule=time_rule
        )
        index = list(xdr)

    if tzinfo is not None:
        index = [d.replace(tzinfo=tzinfo) for d in index]

    index = np.array(index, dtype=object, copy=False)
    index = index.view(cls)
    index.name = name
    index.offset = offset
    index.tzinfo = tzinfo
    return index


# Traceback (ValueError)
In [17]: date_range(datetime.datetime.today(), periods=10, freq='2h20m')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/chang/Dropbox/git/pandas/<ipython-input-17-ff4e03382573> in <module>()
----> 1 date_range(datetime.datetime.today(), periods=10, freq='2h20m')

/home/chang/Dropbox/git/pandas/pandas/tseries/index.pyc in date_range(start, end, periods, freq, tz, normalize)
1209     """
1210     return DatetimeIndex(start=start, end=end, periods=periods,
-> 1211                          freq=freq, tz=tz, normalize=normalize)
1212
1213

/home/chang/Dropbox/git/pandas/pandas/tseries/index.pyc in __new__(cls, data, freq, start, end, periods, copy, name, tz, verify_integrity, normalize, **kwds)
202
203         if data is None and offset is None:
--> 204             raise ValueError("Must provide freq argument if no data is "
205                              "supplied")
206

ValueError: Must provide freq argument if no data is supplied

# Fixed code
def __new__(
    cls,
    start=None,
    end=None,
    periods=None,
    offset=datetools.bday,
    time_rule=None,
    tzinfo=None,
    name=None,
    **kwds,
):
    import warnings

    warnings.warn("DateRange is deprecated, use DatetimeIndex instead", FutureWarning)

    if time_rule is None:
        time_rule = kwds.get("timeRule")
    if time_rule is not None:
        offset = datetools.get_offset(time_rule)

    return DatetimeIndex(
        start=start,
        end=end,
        periods=periods,
        freq=offset,
        tzinfo=tzinfo,
        name=name,
        **kwds,
    )