title: Decorator to automate "for arg in self.args" process in class methods
body: <p>I created a child class that extends a single parameter from the Parent to <code>*args</code> and yields the outputs. However, it looks cleaner with a decorator instead of writing <code>for arg in self.args: yield</code> in multiple methods.</p>
  
  <pre class="lang-py prettyprint-override"><code># Parent class
  class _greet:
  
      def _hello(self,name):
          return "hello " + name
  
      def _hey(self,name):
          return "hey " + name
  
  # Child class
  class Greet(_greet):
  
      def __init__(self,*names):
          self.names = names
  
      def hello(self):
          for name in self.names:
              yield super()._hello(name)
  
      def hey(self):
          for name in self.names:
              yield super()._hey(name)
  </code></pre>
  
  <p>Although, all of my tries generated an error, because the decorator cannot "find" <code>self.args</code>.</p>
  
  <hr>
  
  <p>Edit:<br>
  The idea behind this is to get something like:</p>
  
  <pre class="lang-py prettyprint-override"><code>class Greet(_greet):
  
      def __init__(self,*names):
          self.names = names
  
      @args(names)
      def hello(self, var=name):
          super()._hello(var)
  </code></pre>