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

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -