Monday, September 18, 2006

Python: Stacked Thread-local Object

This is a cute trick: Registry for handling request-local module globals sanely.

It has all the ease of use of globals but with the thread-safety of shoving everything in a per-request object called ctx.

3 comments:

Ian Bicking said...

Your link doesn't link to anything.

I suspect paste.registry does what the target (if a target existed) does.

Anonymous said...

Use the source, Luke. It *is* paste.registry. ;)

Shannon -jj Behrens said...

Sorry about that. "hef" != "href" ;)