title: Macros in python
body: <p>in my project I have to repeat often such part of code:</p>
  
  <pre><code>class SimplePhysicObject(Object):
      def __init__(self):
          super(Object, self).__init__('SimplePhysicObject')
  </code></pre>
  
  <p>But instead of <code>SimplePhysicObject</code> there is new string each time. Are there any ways to write some macro to make this work easier? Something like:</p>
  
  <pre><code>DoTemplate(NewObject)
  ==&gt;
  class NewObject(Object):
      def __init__(self):
          super(Object, self).__init__('NewObject')
  </code></pre>
  
  <hr>
  
  <p><strong>UPD</strong> Sorry, <code>Object</code> is my own class declared before in code</p>