(this thread may be closed already but...) while looking for something else, I found another cool way of memoizing: http://effbot.org/zone/default-values.htm It uses an empty dictionary as a function argument. Usually a source of confusion (for me at least!), but in this case I find it quite useful. Regards, Albert-Jan