From 0c496ecd71b39c314ae7e1e8fec897821953271f Mon Sep 17 00:00:00 2001 From: Thomas Wade Date: Tue, 25 Sep 2018 19:01:07 +0930 Subject: [PATCH] Add constructor for User class This was causing issues where appending to any of the lists would update the class variable rather than the instance variable, leading to everyone having the same likes, tracks, etc. --- scrape.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scrape.py b/scrape.py index 6042b33..65dda64 100755 --- a/scrape.py +++ b/scrape.py @@ -48,11 +48,18 @@ class User: following_count = None follower_count = None - tracks = [] - likes = [] + tracks = None + likes = None - followers = [] - following = [] + followers = None + following = None + + + def __init__(self): + self.tracks = [] + self.likes = [] + self.followers = [] + self.following = [] class Track: url = ''