Help us!

Take some time to transcribe PyCon 2014 talks! Click on the "Share" button below the video and then "Subtitle" to get started.

The Meaty Parts of Python: Closures, Decorators, List Comprehension, and Functional Constructs

Description

The Meaty Parts of Python: Closures, Decorators, List Comprehension, and Functional Constructs

Presented by Matt Harrison

Are you new to Python and want to learn how to step it up to the next level? Have you wondered about functional programming, closures, decorators, generators or list comprehensions and when you should use them? This hands-on tutorial will cover these intermediate subjects in detail, by explaining the theory behind them then walking through examples. It will also cover how to test such programs. The session will conclude with some basic problems to work through.

Outline:

  • Testing (45 min)
    • unittest
    • doctest
    • brief code coverage intro
    • other testing tools
  • Functional Programming (15 min)
    • lambda
    • map
    • reduce
    • filter
    • Substitutes for above constructs
  • Functions (20 min)
    • callables
    • arguments (args, kw)
    • mutable parameters
  • Scoping (10 min)
  • Closures (5 min)
  • Decorators (20 min)
    • Simple decorators
    • parameterized decorators
    • mangling
    • templates for decorators
    • classmethod staticmethod
  • Properties (5 min)
  • List comprehensions (10 min)
  • Iterator pattern (5 min)
  • Generators (15 min )
  • Hands-on application (50 min)