I was trying to play around with Nikola’s code today and learnt about a documented weirdness of Python’s reload.

The behavior is well documented, along with a reasoning of why it is the way it is, but you can trip over it if you don’t know. I hit a bug and was wondering if there was a race condition somewhere, until I read the docs for reload. On reload, the module dict is updated, instead of creating a new dict. Any values not redefined in the new code for the module remain unchanged.