curry.utility.binding module
- curry.utility.binding.binding(mapping, key, value)[source]
Context manager that temporarily binds a value in some mapping.
- Parameters:
mapping – The mapping to modify.
key – The key indicating which item to modify.
value – The temporary value to use, or the special object
del_.
- Returns:
A context manager within which
mapping[key]will be bound tovalue. If value isdel_, then the element will be deleted. The original state will be restored when exiting the context.