Python pass instance of itself as an argument to another function
<p>I have a UserModel class that will essentially do everything like login and update things.</p>

<p>I'm trying to pass the instance of itself (the full class) as an argument to another function of another class.</p>

<p>For example: (obviously not the code, but you get the idea)</p>

<pre><code>from Car import CarFactory

class UserModel:
    def __init__(self,username):
        self.username = username

    def settings(self,colour,age,height):
        return {'colour':colour,'age':age,'height':height}

    def updateCar(self,car_id):
        c = CarFactory(car_id, &lt;&lt;this UserModel instance&gt;&gt;)
</code></pre>

<p>So, as you can see from the very last line above I would like to pass an instance of UserModel to the CarData class, so when within the CarData class I can access the UserModel.settings(), however, I am unsure of the syntax. I could of course just do:</p>

<pre><code>c = CarFactory(car_id,self.settings)
</code></pre>

<p>Any help would be grateful appreciated.</p>

<p>Thanks</p>
