Skip to content

Reduce await in lazy objects #2

Closed
@vishes-shell

Description

@vishes-shell

It's frustration to make extra await

project = await gl.projects.get(id=1, lazy=True)
issues = await project.issues.list()
# or even worse
issues = await (await gl.projects(id=1, lazy=True)).issues.list()

There is no chance to keep together async version of .get() and do not require await lazy object so easiest solution is to introduce GetMixin.get_lazy(id, **kwargs):

issues = await gl.projects.get_lazy(id=1).issues.list()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions