title: How to use python metaclass for the following scenario?
body: <p>I want to create a configuration class with cascading feature. What do I mean by this? let say we have a configuration class like this</p>
  
  <pre><code>class BaseConfig(metaclass=ConfigMeta, ...):
     def getattr():
         return 'default values provided by the metaclass'
  
  class Config(BaseConfig):
     class Embedding(BaseConfig, size=200):
         class WordEmbedding(Embedding):
             size = 300
  </code></pre>
  
  <p>when I use this in code I will access the configuration as follows,</p>
  
  <pre><code>def function(Config, blah, blah):
      word_embedding_size = Config.Embedding.Word.size
      char_embedding_size = Config.Embedding.Char.size
  </code></pre>
  
  <p>The last line access a property which does not exist in <code>Embedding</code> class 'Char'. That should invoke <code>getattr()</code> which should return <code>200</code> in this case. I am not familiar with metaclasses enough to make a good judgement, but I gues I need to define the <code>__new__()</code> of the metaclass.</p>
  
  <p>does this approach makes sense or is there a better way to do it?</p>
  
  <p>EDIT:</p>
  
  <pre><code>class Config(BaseConfig):
     class Embedding(BaseConfig, size=200):
         class WordEmbedding(Embedding):
             size = 300
     class Log(BaseConfig, level=logging.DEBUG):
         class PREPROCESS(Log):
             level = logging.INFO
  
  #When I use 
  log = logging.getLogger(level=Config.Log.Model.level) #level should be INFO
  </code></pre>