Context managers¶
- class satella.coding.EmptyContextManager(*args, **kwargs)¶
A context manager that does nothing. Only to support conditional change of context managers, eg in such a way:
>>> if tx_enabled: >>> ctxt = transaction.atomic >>> else: >>> ctxt = EmptyContextManager() >>> with ctxt: >>> ...
Note that it will accept any parameters, and then throw them on the ground.