Understanding the with Statement in Python