title: strange behavior when using list of another class objects as class attribute in python
body: <p>I am having some issues with the classes below:</p>
  <pre><code>class book:
      def __init__(self,name=None):
          self.name=name
          return
      
  class bookshelf:
      def __init__(self,books=[]):
          self.books=books
          return
      def add_book(self,name):
          self.books.append(
              book(name)
          )
          return
  </code></pre>
  <p>Next, I initialize list a list of bookshelves:</p>
  <pre><code>bookshelves = [bookshelf() for i in range(3)]
  </code></pre>
  <p>With all of them empty, both <code>bookshelfs[0].books</code> and <code>bookshelfs[1].books</code> are <code>[]</code>.</p>
  <p>However, after adding a book to the first bookshelf,</p>
  <pre><code>bookshelves[0].add_book('Book1')
  </code></pre>
  <p>all books have a book named &quot;Book1&quot;: both <code>bookshelves[0].books[0].name</code> and <code>bookshelves[1].books[0].name</code> have the value <code>'Book1'</code>.</p>
  <p>This does not change even after I reinitialize the list of <code>bookshelf</code>. But if I rerun the section defining the classes, the <code>bookshelf</code>s will be cleared.</p>
  <p>Any ideas how does this happen? How should I implement this part correctly? By the way, I am running Python 3.8.3 .</p>