title: Calling Python functions/methods with zero arguments
body: <p>According to <a href="https://rads.stackoverflow.com/amzn/click/com/0132350882" rel="nofollow noreferrer" rel="nofollow noreferrer">Clean Code</a>, a function should take zero arguments when at all possible.</p>
  
  <p>If we take a trivial example in Python with a function that does nothing more than add 2 to whatever is passed to it:</p>
  
  <pre><code>def add_two(x):
      return x + 2
  
  &gt;add_two(1)
  3
  </code></pre>
  
  <p>The only way I can see that such a function can have zero arguments passed to it is by incorporating it into a class:</p>
  
  <pre><code>class Number(object):
      def __init__(self, x):
          self.x = x
  
      def add_two(self):
          return self.x + 2
  
  &gt;n = Number(1)
  &gt;n.add_two()
  3
  </code></pre>
  
  <p>It hardly seems worth the effort. Is there another way of achieving the no-argument function in this example?</p>