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

Tutorial not working #49

Closed
sofianito opened this issue Aug 29, 2017 · 3 comments
Closed

Tutorial not working #49

sofianito opened this issue Aug 29, 2017 · 3 comments
Assignees

Comments

@sofianito
Copy link

Hi!

I'm getting an error at line 47: return reduce(lambda s, (f, x): f(s, x), list, z)

It complains about the ( before f

@patrickmesana
Copy link

Anyone using this project?

@infectious
Copy link

I asked someone smarter than me and he said to change that line to:

return reduce(lambda x, y: y[0](x, y[1]), list, z)

@escalonn
Copy link

escalonn commented Dec 28, 2017

The line as written here works in Python 2.x. But parameter tuple unpacking was removed in Python 3. The version here is the equivalent way to write it in Python 3 and also works in Python 2.

The lambda could be written like this to make the comparison clearer
lambda s, f_x: f_x[0](s, f_x[1])

vlasovskikh added a commit that referenced this issue Jun 13, 2020
@vlasovskikh vlasovskikh self-assigned this Jun 13, 2020
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

5 participants