Hi,
I'm trying to turn o list of objects into a dictionary using a list
comprehension.
Something like
entries = {}
[entries[int(d.date.strf time('%m'))] = d.id] for d in links]
I keep getting errors when I try to do it. Is it possible? Do
dictionary objects have a method equivalent to [].append? Maybe a
lambda?
Thanks for your help!
Erik
I'm trying to turn o list of objects into a dictionary using a list
comprehension.
Something like
entries = {}
[entries[int(d.date.strf time('%m'))] = d.id] for d in links]
I keep getting errors when I try to do it. Is it possible? Do
dictionary objects have a method equivalent to [].append? Maybe a
lambda?
Thanks for your help!
Erik
Comment