werkzeug.release_local¶
-
werkzeug.
release_local
(local)[source]¶ Releases the contents of the local for the current context. This makes it possible to use locals without a manager.
Example:
>>> loc = Local() >>> loc.foo = 42 >>> release_local(loc) >>> hasattr(loc, 'foo') False
With this function one can release
Local
objects as well asLocalStack
objects. However it is not possible to release data held by proxies that way, one always has to retain a reference to the underlying local object in order to be able to release it.New in version 0.6.1.