The Tree Trimming Issue

Part I

How would I traverse a tree structure but handle each node according the sequence of handler dependencies? Or, to put it another way, manipulate one tree of "objects" with another tree of "functions". This is a problem I've found myself thinking about and what follows is just my heavily diagrammed description of it.

Read more...

Tags: patterns

Prototype Pattern

I started reading Mark Summerfield's new book Python in Practice. The first section covers object-oriented software design patterns. Everytime I come across an article or a book that goes over patterns I tell myself I need to make a point of illustrating these from my own experiences, as I can never remember all their names. Here's an example of the prototype pattern from a recent bit of code.

Read more...

Tags: pythonpatterns