Performance on local constants?

John Machin sjmachin at lexicon.net
Thu Dec 27 16:37:55 EST 2007


On Dec 28, 7:53 am, "Matthew Franz" <mdfr... at gmail.com> wrote:
> I get class Searcher(object) but can't for the life of me see why
> (except to be intentionally obtuse) one would use the def
> searcher(rex) pattern which I assure you would call with
> searcher(r)(t) right?
>

The whole point of the thread was performance across multiple searches
for the one pattern. Thus one would NOT do
    searcher(r)(t)
each time a search was required; one would do
    s = searcher(r)
ONCE, and then do
    s(t)
each time ...



More information about the Python-list mailing list