Skip to content

simpler method possible, that distinguishes thanbles from within. #13

@japrogramer

Description

@japrogramer

This line has an equivalent method that I think should be one method. if we check if the data is a then-able object
and branch execution from there

def connection_from_list(data, args=None, **kwargs):

def connection_from_promised_list(data_promise, args=None, **kwargs):

Im thinking something like this

if is_thenable(data):
     return Promise.resolve(data).then(
         lambda data: data, len(data)).then(
             lambda data, _len: connection_from_list_slice(
                 data,
                 args,
                 slice_start=0,
                 list_length=_len,
                 list_slice_length=_len,
                 **kwargs))
_len = len(data)
return connection_from_list_slice(
        data,
        args,
        slice_start=0,
        list_length=_len,
        list_slice_length=_len,
        **kwargs
    )

Let me know if there is a specific reason, why there are two methods

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions