Closure In Python, a function is also an object. Therefore, when we define a function, we can nest another function and return the nested function, for example: from math import pow def make_pow(n): Def inner_func(x): # Nested definition of inner_func return pow(x, n) # Note that n of the external function is quoted here return inner_func &n
1. Python Advanced: Closure Carrying State
Introduction: In Python, a function is also an object. Therefore, when we define a function, we can define another nested function and return the nested function, for example:
2. I don’t quite understand the concept of PHP session.
Introduction: Mainly because I don’t quite understand how the session life cycle is calculated and how it carries status information. I hope you can give me some advice.
[Related Q&A recommendations]:
I don’t quite understand the session concept of PHP
The above is the detailed content of Recommended articles about carrying status. For more information, please follow other related articles on the PHP Chinese website!