HN user

DemetriousJones

3 karma
Posts0
Comments10
View on HN
No posts found.

One of my biggest gripes with python is the fact that the only way to create a local scope for variables is with functions.

I understand if statements not having their own scope for simplicity's sake, but the fact that `with` blocks don't is simply mind-bobbling to me. ``` with open("text.txt", 'w') as f: f.write("hello world") f.write("hello world") # at least the handle was automatically closed so it will give an IO error ```