Skip to content
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

Added consumer sync callbacks support. #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hellysmile
Copy link

No description provided.

while True:
parent = fn

fn = getattr(parent, 'func', None)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this code seems just fine, it would be better to update the state in one line like this:

parent, fn = fn, getattr(parent, 'func', None)

see https://youtu.be/OSGv2VnC0go?t=34m for lengthier explanation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how to do first iteration?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initializing outside of the loop seems like a good idea and would also avoid using True:

parent = fn
while fn is not None:
    parent, fn = fn, getattr(parent, 'func', None)

@dzen
Copy link
Contributor

dzen commented Feb 16, 2017

Hi ! this issue was previously discuted. It was implemented this way, but we ended in removing this checks : #55

cc @smurfix for further details and if it will break his code.

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

Successfully merging this pull request may close these issues.

3 participants