As a Pythonista I have no idea what the Ruby snippet is doing. Readability depends entirely on context.<p>The Python 3 version is using a function annotation.<p>In Python 2 or 3 you could use a context manager (with statement) to similar effect.