title: Python generic type wrapper
body: <p>I am assuming this question has been asked a million times already but I can't seem to make sense of a few things so please bear with me here. I am trying to make do generic inheritance in Python. This is what I want to accomplish: I have a method that takes in a generic type and it returns a class that has been inherited from that parent class</p>
  <p>this is what the code looks like</p>
  <pre><code>def make_foo(parent):
      class Relationship(parent):
          # def __init__(self):
  
          @staticmethod
          def should_see_this_method(self):
              print(&quot;Hello here&quot;)
              return True
  
      return Relationship
  </code></pre>
  <p>Now this is the piece of code I am have</p>
  <pre><code>NewType = make_relationship(str)
  another_test: NewType = &quot;Hello&quot;
  another_test.should_see_this_method()
  another_test.capitalize()
  </code></pre>
  <p>Now I am getting <code>AttributeError: 'str' object has no attribute 'should_see_this_method' </code></p>
  <p>I am not sure if this is anti pattern or not but I am just curios to know how I can do this.</p>
  <p>thanks</p>