title: Python: Implementation of shallow and deep copy constructors
body: <p>It is in most of the situations easy to implement copy constructors (or overloaded assignment operator) in C++ since there is a concept of pointers. However, I'm quite confused about how to implement shallow and deep copy in Python.</p>
  
  <p>I know that there are special commands in one of the libraries but they don't work on classes that you have written by yourself. So what are the common ways to implement?</p>
  
  <p>P.S. Showing process on some basic data structures (linked list or tree) will be appreciated.</p>
  
  <p>EDIT: Thanks, they worked, it was my mistake in syntax.
  I am very interested in overwriting these functions with <code>__copy__()</code> and <code>__deep_copy()__</code>. For example. how can I make a deep copy without knowing which type of information is in a data structure?</p>