Sections
Personal tools
You are here: Home » Faculty and Staff » Hale, Walker » November 15
 

November 15

Up one level
Materials from the November 15 class
November 15 assigment_due_2006_11_29.py
Homework assignment due November 29
November 15 A Warning to PythonWin users
If you are using PythonWin to do this homework, you will get stuck on your first error. This page explains what to do about it.
November 15 Monkey Patch
Wikipedia article describing the Monkey Patch -- a technique for patching the behavior of a library at runtime without touching the source code for the library.
November 15 Python Cookbook
This website is a collection of recipes of Python code for many different things. If you are looking for a metaclass, decorator, or descriptor to do something fancy, then this is the place to go.
November 15 Lazy Attributes
An example recipe. Here a custom descriptor and metaclass allow you to define a class with attributes that will only be computed when needed. When the value is finally computed, it is stored in the object.
November 15 Cache Decorator
Another sample recipe. This decorator can be applied to any callable. It will cache the results of the computation, so that if the callable is invoked again with the same parameters the result will be fetched from the cache.