Release the contents of the local for the current context. This makes it possible to use locals without a manager. With this function one can release :class:`Local` objects as well as :class:`StackLocal` objects. However it's not possible to release data held by proxies that way,
(local)
| 92 | |
| 93 | |
| 94 | def release_local(local): |
| 95 | """Release the contents of the local for the current context. |
| 96 | |
| 97 | This makes it possible to use locals without a manager. |
| 98 | |
| 99 | With this function one can release :class:`Local` objects as well as |
| 100 | :class:`StackLocal` objects. However it's not possible to |
| 101 | release data held by proxies that way, one always has to retain |
| 102 | a reference to the underlying local object in order to be able |
| 103 | to release it. |
| 104 | |
| 105 | Example: |
| 106 | >>> loc = Local() |
| 107 | >>> loc.foo = 42 |
| 108 | >>> release_local(loc) |
| 109 | >>> hasattr(loc, 'foo') |
| 110 | False |
| 111 | """ |
| 112 | local.__release_local__() |
| 113 | |
| 114 | |
| 115 | class Local: |
no test coverage detected