by Ryan Kelly
This talk will explore the use of python's meta-programming facilities to create a simple declarative API so that you can *say what you mean* - write code that focuses on the what and the why without being cluttered by the how. If you've ever wondered how the Django ORM or SQLObject work their magic, this is the talk for you.
As motivating example and case study, I will build from scratch a basic clone of the "dexml" module, which lets you work with XML documents in a declarative, object-oriented manner. Through judicious use of decorators, descriptors and metaclasses, it packs a lot of logic and functionality into a very thin API.
by Dr. Graeme Cross
The inbuilt decorators are commonly used by Python programmers to define static methods, class methods and properties, but many Python programmers don't know how to create their own custom decorators that can simplify their code, making it more readable, easier to extend and also easier to maintain.
This tutorial will teach you the fundamental concepts of decorators, how to write your own decorators and also how to ensure your decorators play nice with functions, methods, docstrings and debuggers.
20th–21st August 2011