Can I get a value's name

2009-05-11 Thread jalanb3
Context for this question arises from some recent code. In particular the replace_line method, which takes in a regexp to look for, and a replacement for when it matches. It is supposed to work for single lines only (we add ^ and $ to the regexp), so arguments which have '\n' in them are not

Why is it faster the second time ?

2009-01-25 Thread jalanb3
Hello the group, I am wondering why doctests run slower the first time. In the transcript below try is a script which finds and runs doctests in the current directory. It also shows how long it takes to run these tests. I added a new test which searches recursively for files given a path, and it

Easy caching

2008-11-12 Thread jalanb3
Evening all, And thank you for your valuable reading skills. The following pattern turned up in coding tonight. It works, but I'm suspicious, it just seems too easy. So any comments or constructive criticisms welcome ? *** Start doctest format *** class Cacher: ... def