Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No it's not the same. The visibility of variable "foo" is extended beyond it's usefullness if you use `if`.


No, the visibility of `foo` is the same in both examples. Python’s `if` statements do not introduce a new scope.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: