title: What is the python equivalent of c++ const-reference copy-constructor arguments
body: <p>One of the great things of C++ is the usage of <code>const</code>-reference arguments – using these type of argument, you're pretty much guaranteed objects won’t be accidentally modified, and there won’t be side effects.</p>
  
  <p>Question is, what’d be the Python equivalent to such arguments?</p>
  
  <p>For instance, let’s say you have this C++ method:</p>
  
  <pre><code>void Foo::setPosition(const QPoint &amp;position) {
      m_position = position;
  }
  </code></pre>
  
  <p>And you want to “translate” it to Python like this:</p>
  
  <pre><code>def set_position(self, position):
      self.position = position
  </code></pre>
  
  <p>Doing this will potentially yield a lot of trouble, and many subtle bugs could appear as well. Question is, what’s the “Python equivalent” way of C++ methods which use const references arguments (copy constructor)?</p>
  
  <p>Last time I caught a bug because a I had a bad “C++ -> Python translation”; I fixed this with something like:</p>
  
  <pre><code>my_python_instance.set_position(QPoint(pos))
  </code></pre>
  
  <p>… said otherwise, my other choice was to clone the object from the caller… which I’m pretty much sure is not the right way to go.</p>