closure
-
[Python] - Closure개발/Python 2022. 7. 28. 20:59
Closure 1. Nested functions A function that is defined inside another function is known as a nested function. Nested functions are able to access variables of the enclosing scope. In Python, these non-local variables can be accessed only within their scope and not outside their scope. But Closure can be access non-local variables #nested function example def nested_func(text): temp = text def te..
-
[Python] - First class functions개발/Python 2022. 7. 28. 17:55
1. First class Obejct Define 1. You can store them in Variable , Data Structure(list,dictionary .. ) 2. You can pass the function as a parameter to another function 3. You can return the function from a function. 2. First class functions Python support first class functions, it means function is instance of Object. First class functions includes First class Object properties. First class functio..