### Navigation

- index
- modules |
- next |
- previous |
- home|
- search|
- documentation »
- The IPython API »

# Module: `utils.nested_context`

Backwards compatibility - we use contextlib.nested to support Python 2.6, but it’s removed in Python 3.2.

## 1 Function

`IPython.utils.nested_context.``nested`(*args, **kwds)

  Combine multiple context managers into a single nested context manager.

  This function has been deprecated in favour of the multiple manager form of the with statement.

  The one advantage of this function over the multiple manager form of the with statement is that argument unpacking allows it to be used with a variable number of context managers as follows:

      with nested(*managers):
          do_something()

### Navigation

- index
- modules |
- next |
- previous |
- home|
- search|
- documentation »
- The IPython API »