title: Writing a class for books in Python
body: <p>I'm writing a class in Python that keeps track of a selection of books. There are three instance variables: <code>author</code>, <code>title</code>, and <code>book_id</code>. There are four methods:</p>
  
  <ol>
  <li><code>__init__(self, author, title, book_id)</code>: (constructor; instantiates all instance variables.)</li>
  <li><code>__str__(self)</code>: returns string representation with this format 
  <code>Book("Homer", "The Odyssey", 12345)</code></li>
  <li><code>__repr__(self)</code>: returns same string representation as <code>__str__</code></li>
  <li><code>__eq__(self,    other)</code> determines if book itself is equivalent to the other book by checking if all three instance variables are the same. Returns a <code>bool</code>.</li>
  </ol>
  
  <p>I've reached a road block. Here is the code I have so far I have gotten a good start. For some reason I keep getting indent errors with the return for the <code>__repr__</code> method. If anyone familiar with writing classes has any advice I'd appreciate it.</p>
  
  <pre><code>class Book:
      def __init__(self, author, title, book_id):
          self.author = author
          self.title = title
          self.book_id = book_id
  
      def __str__(self):
          return 'Book(author, title, book_id)'
  
      def __repr__(self):
  
          return 'Book(author, title, book_id)'
  
      def __eq__(self, other):
  
      #Not sure if this is the right approach
  
          for title in Book:
              for title in Book:
                  if title == title:
                      if author == author:
                          if book_id == book_id:
                              return True 
  </code></pre>