Enclosed scope in Python