Now the above might be the most beneficial pragmatic direct solution here, but there's the potential for a race condition (based upon what you're hoping to perform), and the fact that the fundamental implementation utilizes a consider, but Python makes use of consider in all places in its implementation.The acknowledged reply and some other answers