def tree2rec(tree,
             branches=None,
             selection=None,
             object_selection=None,
             start=None,
             stop=None,
             step=None,
             include_weight=False,
             weight_name='weight',
             cache_size=-1):  # pragma: no cover
    """View the result of :func:`tree2array` as a record array.

    .. warning:: ``tree2rec`` is deprecated and will be removed in
       release 5.0.0. Instead use ``tree2array(...).view(np.recarray)``.

    Notes
    -----
    * This is equivalent to::

        tree2array(treename, branches).view(np.recarray)

    * Refer to the :ref:`type conversion table <conversion_table>`.

    See Also
    --------
    tree2array

    """
    warnings.warn("tree2rec is deprecated and will be removed in 5.0.0. "
                  "Instead use tree2array(...).view(np.recarray)",
                  DeprecationWarning)
    return tree2array(tree,
                      branches=branches,
                      selection=selection,
                      object_selection=object_selection,
                      start=start,
                      stop=stop,
                      step=step,
                      include_weight=include_weight,
                      weight_name=weight_name,
                      cache_size=cache_size).view(np.recarray)
View the result of :func:`tree2array` as a record array.

    .. warning:: ``tree2rec`` is deprecated and will be removed in
       release 5.0.0. Instead use ``tree2array(...).view(np.recarray)``.

    Notes
    -----
    * This is equivalent to::

        tree2array(treename, branches).view(np.recarray)

    * Refer to the :ref:`type conversion table <conversion_table>`.

    See Also
    --------
    tree2array