title: Object is changed in Python
body: <p>I am newbie to python and OOP concepts and i am unable to understand certain things,like why some function change the original object and some doesn't. To understand it better, I have put my confusion in comments in the below code snippet. Any help is appreciated. Thanks.  </p>
  
  <pre><code>from numpy import *
  a = array([[1,2,3],[4,5,6]],float)
  print a
  array([[ 1.,  2.,  3.],
         [ 4.,  5.,  6.]]) ### Result reflected after using print a
  a.reshape(3,2) 
  array([[ 1.,  2.],
         [ 3.,  4.],
         [ 5.,  6.]]) ### Result reflected on IDE after applying the reshape function
  print a
  array([[ 1.,  2.,  3.],
         [ 4.,  5.,  6.]]) ### It remains the same as original value of "a", which is expected.
  a.fill(0)
  print a 
  [[ 0.  0.  0.]
   [ 0.  0.  0.]]  ### It changed the value of array "a" , why?
  
  ############# 
  type(reshape) ### If i try to find the type of "reshape" , i get an answer as "function" .
  &lt;type 'function'&gt;
  
  type(fill) ### I get a traceback when i try to find type of "fill", why?
  Traceback (most recent call last):
    File "&lt;pyshell#12&gt;", line 1, in &lt;module&gt;
      type(fill)
  NameError: name 'fill' is not defined
  </code></pre>
  
  <p><strong>My questions are:</strong></p>
  
  <p>1) How do i get to know which function(s)(considering "fill" is a function) are going to change my original object value (in my case its "a") ? </p>
  
  <p>2) Considering(correct me if i am wrong) if "fill" is a function then , why its changing the original value of the object "a" ?</p>
  
  <p>3) Why am I getting a traceback when i use type(fill) ?</p>