Skip to content

Reduce await in lazy objects #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vishes-shell opened this issue Feb 20, 2020 · 1 comment
Closed

Reduce await in lazy objects #2

vishes-shell opened this issue Feb 20, 2020 · 1 comment

Comments

@vishes-shell
Copy link
Owner

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()
@vishes-shell
Copy link
Owner Author

Would be resolved in #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant