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

Could you give an example?

Do you mean something like

> [ manager.name for manager in set([ person.manager for person in employees ])]

?

I assume with something like set() or unique() you need to create the intermediate iterable anyway, but without it I have trouble finding an example where doing a single list comprehension wouldn't suffice.



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

Search: