Don&#x27;t forget the part where checking for preconditions opens you up to race conditions e.g.<p><pre><code>    if not file_exists(filepath):
        stderr(&quot;invalid config filepath!&quot;)
    # filepath is removed by an external tool
    config = read_file(filepath) # blows up file does not exist</code></pre>