Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OP wrote the code as if the list items were dictionaries, so I just made that pythonic. If they are objects whose attributes we care about then we can get rid of the two getters altogether which are mostly there to make the code more legible but also remove duplication. You could also switch them to attrgetters.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: