Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closure function
#3
But, how can python know a function is a closure function and retain the required information ?. I didn't call the multiplier in make_multiplier_of so python doesn't know that i'll use an enclosing scope's variable (because python runs the body code only when the function is called). So how can python still retain the value of n and didn't delete the name and the value (in this case because i don't have other reference to that value) as it usually does
Reply


Messages In This Thread
Closure function - by Uchikago - Jul-11-2019, 09:06 AM
RE: Closure function - by Gribouillis - Jul-11-2019, 10:21 AM
RE: Closure function - by Uchikago - Jul-11-2019, 10:36 AM
RE: Closure function - by Gribouillis - Jul-11-2019, 11:03 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020