Why does one work, but not the other?

j_mckitrick j_mckitrick at bigfoot.com
Thu Jun 17 21:54:30 EDT 2004


I've done this before:

        data = [self.cong.tm[k] for k in self.cong.tm.li]
#li is list, tm is dict

instead of:

         for k in self.cong.tm.li:
             data.append(self.cong.tm[k])

but when I try:

        self.liststore = [[item] for item in data]


instead of:

       for item in data:
            self.liststore.append([item])

I get an empty list!  What gives??

jonathon



More information about the Python-list mailing list