Created
January 17, 2012 00:10
-
-
Save vitalbh/1623741 to your computer and use it in GitHub Desktop.
Ordenando uma lista de objetos por um atributo do objeto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list = list(lista1) + list(lista2) | |
| list.sort(key=lambda x: x.atributo) #funcao anonima |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment