title: Pythonic: use of __dict__ in the function self.__init__ of a class
body: <p>While coding a new class with the <em>spyder</em> IDE, and using <em>pylint</em> to check the final result, I've ran into error messages (but the code work as expected without error).</p>
  
  <p><strong>Context:</strong> in the constructor function, I want to create new members (quite a lot). Usually, these are few enough so I use this coding:</p>
  
  <pre><code>class MyClass():
      def __init__(self):
          self.a = ...
          self.b = ...
  </code></pre>
  
  <p>But in a case of many members (let's say 10), with all set to the same initial value (let's say they are all dict()), I was tempted to do that:</p>
  
  <pre><code>class MyClass():
      def __init__(self):
          _vars = ["a", "b", "c", ...]
          for _var in _vars:
              self.__dict__[_var] = dict()
  </code></pre>
  
  <p>Further in the class, I was refering to a member using:</p>
  
  <pre><code>class MyClass():
      def my_method(self):
          print self.c
  </code></pre>
  
  <p><strong>Error</strong> with <em>pylint</em> (in <em>spyder</em>):</p>
  
  <p>When using pylint on this file, I've got an error message saying:</p>
  
  <blockquote>
    <p>MyClass.my_method: instance of 'MyClass' has no 'c'member.</p>
  </blockquote>
  
  <p>However, the code runs just fine, without error, ie. I may access the member 'c' without any problem.</p>
  
  <p><strong>Question</strong>: is this a proper coding, or should I avoid such a method to initialize members?</p>