Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. class artist:
  2.     artist = ""
  3.     path = ""
  4.     album = []
  5.    
  6.     def __init__(self):
  7.         # Make a copy of the list album
  8.         # Before instantiation, album is a class reference
  9.         # so it is shared between all instances.
  10.         # Other fields, as immutables give no problem, as the reference
  11.         # is changed when the value is changed.
  12.         self.album = list(album)
  13.  
  14.     def setArtist(self, artist):
  15.         self.artist = artist
  16.     def getArtist(self):
  17.         return self.artist
  18.        
  19.     def setPath(self, path):
  20.         self.path = path
  21.     def getPath(self):
  22.         return self.path
  23.        
  24.     def addAlbum(self, album):
  25.         self.album.append(album)
  26.     def getAlbum(self):
  27.         return self.album
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement