title: Python Changing name of method
body: <p>Using python 3.6. I'm trying to write some code that will allow me to to place a unique identifier on class methods.</p>
  
  <p>Here's an example:</p>
  
  <pre><code>def test(func):
      def wrap():
          pass
      wrap.__name__ += '_TEST'
      return wrap
  
  class example:
      @test
      def method(self):pass
  </code></pre>
  
  <p>Console:</p>
  
  <pre><code>import inspect
  Bar = example()
  inspect.getmembers(Bar, predicate=inspect.ismethod)
  Out[3]: 
  [('method', # Name didn't change 
  &lt;bound method test.&lt;locals&gt;.wrap of &lt;__main__.example object at 
  0x000002670E073EF0&gt;&gt;)]
  Bar.method.__name__
  Out[4]: 'wrap_TEST'
  </code></pre>
  
  <p>I want to be able to loop over methods of a class and only execute the ones I have marked with my decorator. Can this be done?</p>