Advancted functions

  1. Variable scopes
  2. Name resolution order (LEGB)
  3. Scoping: global seen from fuction
  4. Assignment creates local scope
  5. Local scope gone wrong
  6. Changing global variable from a function
  7. Global variables mutable in functions
  8. Scoping issues
  9. sub in sub
  10. Scoping sub in sub (enclosing scope)
  11. Function objects
  12. Functions are created at run time
  13. Mutable default
  14. Use None as default parameter
  15. Inner function created every time the outer function runs
  16. Static variable
  17. Static variable in generated function
  18. Inspect