title: Printing message when class variable is called
body: <p>I'm using a 2 python class as configuration file. One of them contain old parameters (deprecated) and I would like to display a message if a deprecated param is used.</p>
  <p>Here is how I used the different class:</p>
  <p>config_backup.py</p>
  <pre class="lang-py prettyprint-override"><code>class _ConfigBackup:
      PARAM1 = 'a'
      PARAM2 = 'b'
  </code></pre>
  <p>config_new.py</p>
  <pre class="lang-py prettyprint-override"><code>class Config(_ConfigBackup):
      PARAM3 = 'c'
      PARAM4 = 'd'
  
  cfg = Config
  </code></pre>
  <p>Then I can call cfg and have result like this:</p>
  <pre><code>&gt;&gt;&gt; cfg.PARAM3
  'c'
  &gt;&gt;&gt; cfg.PARAM1
  Parameter PARAM1 is deprecated.
  'a'
  </code></pre>
  <p>The function or method would look like this I think:</p>
  <pre><code>def warning(param):
      print(f&quot;Parameter {param.__name__} is deprecated.&quot;)
      return param
  </code></pre>
  <p>I am not exactly sure if this is possible, maybe by using decorator or with statement, any idea ?</p>