def isbytestring(obj):
    """Determine if obj is a byte :class:`bytes`

    In python2 this is equivalent to isinstance(obj, str).  In python3 it
    checks whether the object is an instance of bytes or bytearray.

    :arg obj: Object to test
    :returns: True if the object is a byte :class:`bytes`.  Otherwise, False.

    .. versionadded:: Kitchen: 1.2.0, API kitchen.text 2.2.0
    """
    if isinstance(obj, (bytes, bytearray)):
        return True
    return False
