def create_object_from_list(cls: Type,
                            fieldlist: Sequence[str],
                            valuelist: Sequence[Any],
                            *args, **kwargs) -> T:
    """
    Create an object by instantiating ``cls(*args, **kwargs)`` and assigning the
    values in ``valuelist`` to the fields in ``fieldlist``.

    If ``construct_with_pk`` is ``True``, initialize with
    ``cls(valuelist[0], *args, **kwargs)``
    and assign the values in ``valuelist[1:]`` to ``fieldlist[1:]``.

    Note: in Python 3, we could define as

    .. code-block:: none

        ...(... valuelist, *args, construct_with_pk=False, **kwargs):

    but not in Python 2, and this is meant to be back-compatible.
    """
    construct_with_pk = kwargs.pop('construct_with_pk', False)
    # print("construct_with_pk: {}".format(construct_with_pk))
    # print("args: {}".format(args))
    # print("kwargs: {}".format(kwargs))
    if construct_with_pk:
        obj = cls(valuelist[0], *args, **kwargs)
        assign_from_list(obj, fieldlist[1:], valuelist[1:])
    else:
        obj = cls(*args, **kwargs)
        assign_from_list(obj, fieldlist, valuelist)
    return obj