[Python-ideas] context managers used to allocate resources can be abused - a solution