Design a class in Python for storing information about books. The class should contain fields for the book title, author, and year of publication.
Not applicable
class Book:
  
 def __init__(self, title, author, year):
 self.title = title
 self.author = author
 self.year = year
 
 def __str__(self):
  return f"{self.title} by {self.author} ({self.year})"