title: @staticmethod or function outside class?
body: <p>Assuming I have a <code>class</code> which requires a function (or should I say method) which is:</p>
  
  <ul>
  <li>independent from my <code>class</code> instance - doesn't need <code>self</code> argument;</li>
  <li>is called only inside my <code>class</code> object</li>
  <li>I won't need access to it at any point (to override it for example);</li>
  </ul>
  
  <p>should I (A) place it inside the <code>class</code> and mark it as a <code>@staticmethod</code> or should I (B) define it outside my <code>class</code> object (but in the same namespace)? Why?</p>
  
  <p>Example:</p>
  
  <pre><code>class A:
      def __init__(self, my_int):
          self.my_int = my_int
      def my_int_and_4(self):
          print(self.adder(self.my_int,4))
      @staticmethod
      def adder(a,b):
          return a+b
  </code></pre>
  
  <p>or</p>
  
  <pre><code>def adder(a,b):
      return a+b
  class B:
      def __init__(self, my_int):
          self.my_int = my_int
      def my_int_and_4(self):
          print(adder(self.my_int,4))
  </code></pre>
  
  <p>EDIT: maybe the example is a bit oversimplified. I should have added that my version of "<code>adder</code>" is specificly used with my <code>class</code> and in no other case.</p>