Python puzzler: the import statement and global variables

Recently I’ve joined the BOS team in helping develop the next generation of the survey software. This time round were using Django (a Python-based web framework), PostgreSQL and Cassandra (a NoSQL database).

Although I’ve dabbled with Python briefly in the past this is my first substantial Python-based project. As a new Python developer I hit rather confusing bug in our code recently that concerned the Python import statement and global variables. It’s an interesting little oddity that I thought would be worth writing about. Continue reading