copies of classes in python
<p>Assume I have an instance foo of some class Class with some variable foo.x. Now I want to produce a copy of foo:</p>

<pre><code>bar = foo
</code></pre>

<p>when I now change bar.x, this also changes foo.x. How can I get a copy of foo, where I can change everything without changing the original foo? Creating a new instance of Class is not an option, because I need it in the state in which foo already is.</p>
