==============
Context Locals
==============

.. module:: werkzeug.local


Objects
=======

.. class:: werkzeug.local.LocalManager

    .. def:: werkzeug.local.LocalManager.cleanup
    .. def:: werkzeug.local.LocalManager.make_middleware
    .. def:: werkzeug.local.LocalManager.middleware
    .. def:: werkzeug.local.LocalManager.get_ident

.. class:: werkzeug.local.LocalProxy

    .. def:: werkzeug.local.LocalProxy._get_current_object

    Keep in mind that ``repr()`` is also forwarded, so if you want to find
    out if you are dealing with a proxy you can do an ``isinstance()`` check:

    .. sourcecode:: pycon

        >>> from werkzeug import LocalProxy
        >>> isinstance(request, LocalProxy)
        True

    You can also create proxy objects by hand:

    .. sourcecode:: python

        from werkzeug import Local, LocalProxy
        local = Local()
        request = LocalProxy(local, 'request')
