View Single Post
Old 11-29-2011, 07:09 AM   #2
NotTaken
Connoisseur
NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.NotTaken is fluent in JavaScript as well as Klingon.
 
Posts: 65
Karma: 4640
Join Date: Aug 2011
Device: kindle
Probably not wise to modify the object you are iterating on, plus your feeds list would be badly formed as you are adding tuples of two different forms. I couldn't test but is it any better if you use this code fragment?

Code:
        random.shuffle(feedis)
        feedis = feedis[0:20]
        feeds = []
        
        for title, url in feedis:
            print 'Working on: ', title
            articles = self.make_links(url)
            if articles:
                feeds.append((title, articles))
        return feeds

Last edited by NotTaken; 11-29-2011 at 07:19 AM.
NotTaken is offline   Reply With Quote