title: Class method return list/array
body: <p>I am trying to return a numpy array when calling a class method from a class initialized as a list. </p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  
  class test_object:
  
      def __init__(self, val=1):
          self.value = val
  
      @staticmethod
      def generate(number=5):
  
          # create list of test_objects
          obj = [test_object(val=i) for i in range(number)]
  
          return obj
  
      def powers(self, pow=2):
          return self.value**pow
  
  
  numbers = test_object.generate(number=10)
  
  array = np.zeros(len(numbers))
  
  for i in range(len(numbers)):
      array[i] = numbers[i].powers()
  
  print(array)
  </code></pre>
  
  <p>Is it possible to modify the class / class method 'powers' so, that it will
  work like:</p>
  
  <pre class="lang-py prettyprint-override"><code>array = numbers.powers()
  </code></pre>
  
  <p>The array initializing and the for loop should be done inside the class method.</p>