actual objects and its references in python
<p>I'm a bit confused about actual object and its reference in python.Googled a lot but didn't get what I need. </p>

<p>Does object creation also returns a reference to that object? Why i'm asking this is because I'm able to use actual object with <code>.</code> delimiter to call its methods.We usually use reference of the object to call methods.An example might give a clear idea of what I'm asking.</p>

<p><code>l = [2,4,1,3]</code> # 'l' is a reference to actual object.Right?</p>

<p>does the RHS part create the object and return a reference to that object which'll be assigned to LHS ?</p>

<p>Because I'm able to use both <code>list.sort()</code> and <code>[2,4,1,3].sort()</code> to sort the list. Is <code>[2,4,1,3]</code> an actual object or does it yield a reference along with creating an object?</p>

<p>Similar is the case with Classes.</p>

<p><code>obj=SomeClass()</code> #obj is a reference to object created by SomeClass().</p>

<p>Does <code>SomeClass()</code> return a reference along with creating an object?</p>

<p>Because we can use both <code>obj.method1()</code> and <code>SomeClass().method1</code> to call methods.</p>
