About 9,730,000 results
Open links in new tab
  1. How do nested functions work in Python? - Stack Overflow

    Programmer’s note: Functions are first-class objects. A 'def' form executed inside a function definition defines a local function that can be returned or passed around. Free variables used in the nested …

  2. What are nested functions? What are they for? - Stack Overflow

    Feb 6, 2009 · What is a nested function? Why?!? What can you do with a nested function that you cannot do any other way? What can you do with a nested function this is difficult or inelegant without …

  3. Nested Function in Python - Stack Overflow

    Oct 19, 2009 · 63 Aside from function generators, where internal function creation is almost the definition of a function generator, the reason I create nested functions is to improve readability.

  4. JavaScript Nested function - Stack Overflow

    Nested functions can be the basis for writing a modular group of related functions, kind of halfway to full object-oriented programming (static classes only). Here is an example of such a group of functions, …

  5. Can we have functions inside functions in C++? - Stack Overflow

    Dec 1, 2010 · I've used the gcc extension for support of nested functions (in C, though, not C++). Nested functions are a nifty thing (as in Pascal and Ada) for managing complex, yet cohesive structures that …

  6. Can you write nested functions in JavaScript? - Stack Overflow

    Jul 9, 2010 · I am wondering if JavaScript supports writing a function within another function, or nested functions (I read it in a blog). Is this really possible?. In fact, I have used these but am unsure of this

  7. When is it good to use nested functions in Python?

    For mutable objects it's obviously ok to modify them. In the meantime, it's common to see the defaultarg hacks/idioms in Python2 One (maybe the only) disadvantage of the nested function is that it's difficult …

  8. Real-world examples of nested functions - Stack Overflow

    May 23, 2017 · I asked previously how the nested functions work, but unfortunately I still don't quite get it. To understand it better, can someone please show some real-wold, practical usage examples of …

  9. Nested function in C - Stack Overflow

    Apr 9, 2010 · Nested functions are used in some languages to enclose multiple functions and variables into a container (the outer function) so that the individual functions (excluding the outer function) and …

  10. python - Local variables in nested functions - Stack Overflow

    The nested function looks up variables from the parent scope when executed, not when defined. The function body is compiled, and the 'free' variables (not defined in the function itself by assignment), …