title: __metaclass__ in Python 3
body: <p>In Python2.7 this code can work very well, <code>__getattr__</code> in <code>MetaTable</code> 
  will run. But in Python 3 it doesn't work.</p>
  
  <pre><code>class MetaTable(type):
      def __getattr__(cls, key):
          temp = key.split("__")
          name = temp[0]
          alias = None
  
          if len(temp) &gt; 1:
              alias = temp[1]
  
          return cls(name, alias)
  
  
  class Table(object):
      __metaclass__ = MetaTable
  
      def __init__(self, name, alias=None):
          self._name = name
          self._alias = alias
  
  
  d = Table
  d.student__s
  </code></pre>
  
  <p>But in Python 3.5 I get an attribute error instead:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/wyx/project/python3/sql/dd.py", line 31, in &lt;module&gt;
      d.student__s
  AttributeError: type object 'Table' has no attribute 'student__s'
  </code></pre>