Well, this was just a small change to the existing construct which already used the same logic, but aside from that, and the fact that this is a very common (and pythonic) idiom anyway, I would argue that doing it other ways in a properly threadsafe manner would actually be _more_ complicated (and slower as well) due to having to account for race conditions which are automatically avoided by the try/pop/except construct.