title: Is there a way to instantiate a class without calling __init__?
body: <p>Is there a way to circumvent the constructor <code>__init__</code> of a class in python?</p>
  
  <p>Example:</p>
  
  <pre><code>class A(object):    
      def __init__(self):
          print "FAILURE"
  
      def Print(self):
          print "YEHAA"
  </code></pre>
  
  <p>Now I would like to create an instance of <code>A</code>. It could look like this, however this syntax is not correct.</p>
  
  <pre><code>a = A
  a.Print()
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>An even more complex example:</p>
  
  <p>Suppose I have an object <code>C</code>, which purpose it is to store one single parameter and do some computations with it. The parameter, however, is not passed as such but it is embedded in a huge parameter file. It could look something like this:</p>
  
  <pre><code>class C(object):
      def __init__(self, ParameterFile):
          self._Parameter = self._ExtractParamterFile(ParameterFile)
      def _ExtractParamterFile(self, ParameterFile):
          #does some complex magic to extract the right parameter
          return the_extracted_parameter
  </code></pre>
  
  <p>Now I would like to dump and load an instance of that object <code>C</code>. However, when I load this object, I only have the single variable <code>self._Parameter</code> and I cannot call the constructor, because it is expecting the parameter file. </p>
  
  <pre><code>    @staticmethod
      def Load(file):
          f = open(file, "rb")
          oldObject = pickle.load(f)
          f.close()
  
          #somehow create newObject without calling __init__
          newObject._Parameter = oldObject._Parameter
          return newObject
  </code></pre>
  
  <p>In other words, it is not possible to create an instance without passing the parameter file. In my "real" case, however, it is not a parameter file but some huge junk of data I certainly not want to carry around in memory or even store it to disc.</p>
  
  <p>And since I want to return an instance of <code>C</code> from the method <code>Load</code> I do somehow have to call the constructor.</p>
  
  <p>OLD EDIT:</p>
  
  <p>A more complex example, which explains <strong>why</strong> I am asking the question:</p>
  
  <pre><code>class B(object):    
      def __init__(self, name, data):
          self._Name = name
          #do something with data, but do NOT save data in a variable
  
      @staticmethod
      def Load(self, file, newName):
          f = open(file, "rb")
          s = pickle.load(f)
          f.close()
  
          newS = B(???)
          newS._Name = newName
          return newS
  </code></pre>
  
  <p>As you can see, since <code>data</code> is not stored in a class variable I cannot pass it to <code>__init__</code>. Of course I could simply store it, but what if the data is a huge object, which I do not want to carry around in memory all the time or even save it to disc?</p>