Skip to main content

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.

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. ;)
Sorry about that. "hef" != "href" ;)