Skip to content

Commit

Permalink
lambda fix per @laserson
Browse files Browse the repository at this point in the history
  • Loading branch information
robertzk committed Mar 6, 2015
1 parent 5937989 commit d286215
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/programming-guide.md
Expand Up @@ -1353,8 +1353,11 @@ data.map(x -> accum.add(x); f(x););
<div data-lang="python" markdown="1">
{% highlight python %}
accum = sc.accumulator(0)
data.map(lambda x: acc.add(x) and f(x))
# Here, acc is still 0 because no actions have cause the `map` to be computed.
def g(x):
acc.add(x)
return f(x)
data.map(g)
# Here, acc is still 0 because no actions have caused the `map` to be computed.
{% endhighlight %}
</div>

Expand Down

0 comments on commit d286215

Please sign in to comment.