title: How to tell a function to use the default argument values?
body: <p>I have a function <code>foo</code> that calls <a href="https://docs.python.org/3/library/math.html#math.isclose" rel="noreferrer"><code>math.isclose</code></a>:</p>
  
  <pre><code>import math
  def foo(..., rtol=None, atol=None):
      ...
      if math.isclose(x, y, rel_tol=rtol, abs_tol=atol):
          ...
      ...
  </code></pre>
  
  <p>The above fails in <a href="https://docs.python.org/3/library/math.html#math.isclose" rel="noreferrer"><code>math.isclose</code></a> if I do not pass <code>rtol</code> and <code>atol</code> to <code>foo</code>:</p>
  
  <pre><code>TypeError: must be real number, not NoneType
  </code></pre>
  
  <p>I do not want to put the system default argument values in my code (what
  if they change down the road?)</p>
  
  <p>Here is what I came up with so far:</p>
  
  <pre><code>import math
  def foo(..., rtol=None, atol=None):
      ...
      tols = {}
      if rtol is not None:
          tols["rel_tol"] = rtol
      if atol is not None:
          tols["abs_tol"] = atol
      if math.isclose(x, y, **tols):
          ...
      ...
  </code></pre>
  
  <p>This looks long and silly and allocates a <code>dict</code> on each invocation of
  <code>foo</code> (which calls itself recursively so this <em>is</em> a big deal).</p>
  
  <p>So, what is the best way to tell <a href="https://docs.python.org/3/library/math.html#math.isclose" rel="noreferrer"><code>math.isclose</code></a> to use the default
  tolerances?</p>
  
  <p>PS. There are several related questions. Note that I do <em>not</em> want to know the actual default arguments of <a href="https://docs.python.org/3/library/math.html#math.isclose" rel="noreferrer"><code>math.isclose</code></a> - all I want it to tell it to use the defaults whatever they are.</p>