Alex Martelli, Uber Technical Lead, Google, Inc.
Anna Martelli Ravenscroft
Date: Monday, August 1st, 2005
Time: 1:30pm - 5:00pm
Editing the 2nd Edition of the Python Cookbook was great, but of course we couldn't fit in the book much in-depth analysis and explanation. Here, Martelli and Ravenscroft pick some great stuff from the book, beef it up with thorough explanations of relevant language mechanisms, examples, and related materials, and explore in depth the design choices that Python offers.
Learn about Design Patterns and Object-Oriented idioms and mechanisms. Python is multi-paradigm, with OOP at its core. Understand the pros and cons of alternatives: When should you use closures, when callable instances? When to inherit, when to delegate? What classical Design Patterns are built-in, and which others to consider, and when?
Iterators and Generators underlie Python's new approach to looping--it's not your grandparents' loop any more! Learn how to encapsulate the logic of your control structures, making it reusable. Itertools can turn the "abstraction penalty" of some other languages into an abstraction _bonus_, making your code faster, more abstract, more general.
Descriptors and Metaclasses underpin Python's OOP: Python exposes them and lets you customize them for your own purposes. Add Decorators, the new syntax just introduced in Python 2.4, for a systematic application of a crucial use case for higher-order functions, and you'll see why our working title for that chapter was "Black Magic"... Learn important use cases for each of these advanced mechanisms.
Prerequisites: you need a solid grasp of Python fundamentals to start with. Course objectives: you'll walk out of this a Python wizard!