def startswith(haystack, prefix):
    """
    py3 comp startswith
    :param haystack:
    :param prefix:
    :return:
    """
    if haystack is None:
        return None

    if sys.version_info[0] < 3:
        return haystack.startswith(prefix)

    return to_bytes(haystack).startswith(to_bytes(prefix))