Function object: Difference between revisions

Content deleted Content added
Use Python 3 to demonstrate closures in Python; the Python 2 version is largely obsolete and doesn't add much value to the article
Line 367:
 
var b = Accumulator(42);
x = b(7); // x has value 49 (current = 4249 in closure b)
x = a(7); // x has value 18 (current = 1118 in closure a)
</source>