title: Refactoring a Python class to take a dynamic parameter without changing calling pattern dramatically
body: <p>I have a Python class in a <code>base_params.py</code> module within an existing codebase, which looks like this:</p>
  <pre class="lang-py prettyprint-override"><code>import datetime
  
  class BaseParams:
      TIMESTAMP = datetime.datetime.now()
      PATH1 = f'/foo1/bar/{TIMESTAMP}/baz'
      PATH2 = f'/foo2/bar/{TIMESTAMP}/baz'
  
  </code></pre>
  <p>Callers utilize it this way:</p>
  <pre class="lang-py prettyprint-override"><code>from base_params import BaseParams as params
  
  print(params.PATH1)
  </code></pre>
  <p>Now, I want to replace the <code>TIMESTAMP</code> value with one that is dynamically specified at runtime (through e.g. CLI arguments).</p>
  <p>Is there a way to do this in Python without requiring my callers to refactor their code in a dramatic way? This is currently confounding me because the contents of the <code>class BaseParams</code> get executed at 'compile' time, so there is no opportunity there to pass in a dynamic value as it's currently structured. And in some of my existing code, this object is being treated as &quot;fully ready&quot; at 'compile' time, for example, its values are used as function argument defaults:</p>
  <pre class="lang-py prettyprint-override"><code>def some_function(value1, value2=params.PATH1):
      ...
  </code></pre>
  <p>I am wondering if there is some way to work with Python modules and/or abuse Python's <code>__special_methods__</code> to get this existing code pattern working more or less as-is, without a deeper refactoring of some kind.</p>
  <p>My current expectation is &quot;this is not really possible&quot; because of that last example, where the default value is being specified in the function signature. But I thought I should check with the Python wizards to see if there may be a suitably Pythonic way around this.</p>