The library I'm using has a function that returns an object of type A.

```
a = the_lib.lib_function()  # returns an object of type A

```

I have a class, B, that inherits from A. 

```
class B(A):
    def my_method(self):
        print "This is Travis's class"

```

I want the constructor of B to call the library function and wrap the A object that is returned. I saw the answer to a different question that did this:

```
class B(A):
    def __init__(self):
        a = the_lib.lib_function()
        self.__dict__ = a.__dict__

    def my_method(self):
        print "This is Travis's class"

```

Is there a better way to do this?