title: Python class default to using one function
body: <p>I'm trying to make a Python class (call it <code>CLASS</code>) in which there is a main function (call it <code>FUNC</code>) that most users will wish to use. </p>
  
  <p>In this case I would like the user to be able to call the class name without the need to use brackets before the favourite function eg.:</p>
  
  <p><code>CLASS(B, C)</code> rather than <code>CLASS().FUNC(B, C)</code></p>
  
  <p>This is purely aesthetic but it means that for users who will use FUNC and not care about the other functions they could explicitly call, they don't need to write the annoying curly brackets. </p>
  
  <p>Here is a simple code example of the kind of class I would create, where the main function (which I've called FUNC for continuity) utilises other functions in the class:</p>
  
  <pre><code>class Example:
  
      def dummy_operation(self,A):
          return A*2.
  
      def FUNC(self,B,C):
          A = self.dummy_operation(B)
          result = A + C
          return result
  </code></pre>
  
  <p>So here, <code>Example</code> takes the place of <code>CLASS</code> for legibility. </p>
  
  <p>One way to do this looks like the use of an <code>if '__main__'</code> statement (see - <a href="https://stackoverflow.com/questions/7870869/python-main-call-within-class">Python main call within class</a>).</p>
  
  <p>However, as FUNC takes arguments <code>B</code> and <code>C</code>, this will return an error:</p>
  
  <pre><code>if __name__ == '__main__':
      Example().target_function()
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>TypeError: target_function() missing 2 required positional arguments: 'B' and 'C'
  </code></pre>
  
  <p>Is there a way to pass <code>Example(B,C)</code>, where in fact it is calling <code>Example().FUNC(B,C)</code> but one can still call <code>Example().dummy_operation(A)</code> if required?</p>
  
  <p>Many thanks in advance!</p>