The StackedObjectProxy class is accessible via the paste.registry module.
The StackedObjectProxy proxies access to an object internally using a stacked thread-local. This makes it safe for complex WSGI environments where access to the object may be desired in multiple places without having to pass the actual object around.
New objects are added to the top of the stack with _push_object while objects can be removed with _pop_object.
Create a new StackedObjectProxy
If a default is given, its used in every thread if no other object has been pushed on.
See the source for more information.