O'Reilly logo
  • Chris Kang thinks this is interesting:

For example, the result of make_adder(7) is a function that accepts a single argument and adds 7 to that argument.


Cover of Python in a Nutshell, 3rd Edition


make_adder() returns a reference to a function. Because you passed in "7" into make_added(), calling the returned reference to a function with a parameter will simply add the constant that was initially passed in through make_adder(). So, that initial constant is build into the value to be used by the generated function.