Syllabus

  1. 01Function arguments in depthHow arguments bind to parameters and how to read binding errors, safe defaults with None and sentinels, *args and **kwargs and argument forwarding, keyword-only and positional-only parameters, unpacking in calls, literals and assignments, and a shipping-toolkit project.6 lessons
    1. 01Parameters and arguments
    2. 02Default values done right
    3. 03*args and **kwargs
    4. 04Keyword-only and positional-only parameters
    5. 05Unpacking everywhere
    6. 06Project: a parcel shipping toolkit
  2. 02Namespaces and scopeNames, namespaces and their lifetimes, evaluating code in namespaces you choose, the LEGB lookup rule and its surprises, global and nonlocal, and closures from the inside: cells, late binding and closures versus classes.4 lessons
    1. 01Namespaces: where names live
    2. 02Scope and the LEGB rule
    3. 03Changing outer names: global and nonlocal
    4. 04Closures in depth
  3. 03Functions deep diveFunctions as objects and callables, lambdas, higher-order functions and the operator module, the built-in higher-order toolkit, decorators with wraps, stacking and arguments, and a project building timing, caching, retry and validation decorators.5 lessons
    1. 01Functions are objects
    2. 02Lambdas and higher-order functions
    3. 03Built-in higher-order tools
    4. 04Decorators
    5. 05Project: a decorator toolkit