3 ms·
Right, I'm quite well-aware of that, but I'm saying this change has made the situation even worse. If they ensured the variables were scoped and actually initia
by dataflow 5y ago
Right, I'm quite well-aware of that, but I'm saying this change has made the situation even worse. If they ensured the variables were scoped and actually initialized it'd have actually been an improvement.
- eesmith 5y agoI apologize. I misinterpreted your comment: # w is in-scope here, but possibly nonexistent! # Even in C++ it would at least *exist*! because I don't see how bringing up C++'s semantics is relevant when Python has long raised an UnboundLocalError for similar circumstances. If I understand you correctly, you believe Python should have introduced scoping so the "w" would be valid only in the if, elif, and else clauses, and not after the 'if' ends. This would be similar to how the error object works in the 'except' clause: >>> try: ... 1/0 ... except Exception as err: ... err = "Hello" ... >>> err Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'err' is not defined If so, I do not have the experience or insight to say anything meaningful.