python - Using __str__ after sorting -


i've created list using class photo , sorted list. want print string representation first 3 items in list. code i've written, end blank version of string (like "title:" instead of "title: volcano"). going wrong?

here's bit of code issue:

sorted_p = [] d in sorted(p_i, key = photo.t_c):     sorted_p.append(photo(d)) d in sorted_p[:3]:     print(d) 


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -