query: Weird variable scope in Python when using try/except
positive_passages.docid: 149082
positive_passages.text: Reason for unintuitive UnboundLocalError behaviour
negative_passages.docid: 115412
negative_passages.text: Why does this function fail when a non-function version of the same code works?
negative_passages.docid: 52329
negative_passages.text: Using try vs if in python
negative_passages.docid: 61753
negative_passages.text: Why does python use 'else' after for and while loops?
negative_passages.docid: 115565
negative_passages.text: SyntaxError inconsistency in Python?
negative_passages.docid: 154550
negative_passages.text: unexpected execution of Exceptions in python
negative_passages.docid: 38437
negative_passages.text: Python dictionary comprehension using locals() gives KeyError
negative_passages.docid: 95222
negative_passages.text: Block scope in Python
negative_passages.docid: 56897
negative_passages.text: Python NameError from contents of a variable
negative_passages.docid: 89291
negative_passages.text: Python list.index throws exception when index not found
negative_passages.docid: 36929
negative_passages.text: Why does comparing strings using either '==' or 'is' sometimes produce a different result?
negative_passages.docid: 48135
negative_passages.text: if/else in a list comprehension
negative_passages.docid: 104049
negative_passages.text: Apex strange exception handling
negative_passages.docid: 3412
negative_passages.text: try and Finally giving exception with no return statement , but there is no exception when return statement is written in method
negative_passages.docid: 64071
negative_passages.text: Should I always specify an exception type in `except` statements?
negative_passages.docid: 116724
negative_passages.text: Scoping in Python 'for' loops
negative_passages.docid: 266
negative_passages.text: re.findall behaves weird