title: Python Class Members
body: <p>I am just learning Python and I come from a C background so please let me know if I have any confusion / mix up between both.</p>
  
  <p>Assume I have the following class:</p>
  
  <pre><code>class Node(object):
      def __init__(self, element):
          self.element = element
          self.left = self.right = None
  
      @classmethod
      def tree(cls, element, left, right):
          node = cls(element)
          node.left = left
          node.right = right
          return node
  </code></pre>
  
  <p>This is a class named <code>Node</code>, that overloads the constructor, to be able to handle different arguments if needed.</p>
  
  <p>What is the difference between defining <code>self.element</code> in <code>__init__</code> only (as shown above) as opposed to doing the following:</p>
  
  <pre><code>class Node(object):
      element, left, right = None
      def __init__(self, element):
          self.element = element
          self.left = self.right = None
  </code></pre>
  
  <p>Isn't <code>self.element</code> in <code>__init__</code> the same as the class's <code>element</code> variable defined? Wouldn't that just overwrite <code>element</code> from <code>None</code> to the <code>element</code> value passed into <code>__init__</code>?</p>