Python context managers seem to be sort of a decoupled relative of this. Where this paints the inverse as a feature of the “positive” function, context maangers could conceivably support having many different context managers with the same entrance function and different exit functions.