import six


def _bytes(*vals):
    """
    This is a private utility function which takes a list of byte values
    and creates a binary string appropriate for the current Python version.
    It will return a `str` type in Python 2, but a `bytes` value in Python 3.

    Values should be in byte range, (0x00-0xff)::

        _bytes(1, 2, 3) == six.b('\\x01\\x02\\x03')

    :param vals: arguments are a list of unsigned bytes.
    :return: a `str` in Python 2, or `bytes` in Python 3
    """
    return six.b('').join(six.int2byte(v) for v in vals)