An Edge Case Concerning Python Global Variables
A colleague of mine just came across a rather interesting edge case when working with Python global variables. Of course, most of the time, you should just try to avoid them altogether, but if you do use them you might come across this. If you have a global variable, and you assign to it in a function without using the global keyword, your code will fail to compile. This can result in a confusing error message. Here’s a simplified example: ...