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

I have also encountered this quite often. I'll say the ideal solution would be "postfix streaming methods" like `.filter` and `.map`. Unfortunately, Python doesn't have those (prefix `filter`s and `map`s are not even close), and you have comprehension expressions at best. To make things worse, complex comprehensions can also create confusion, so for your particular example I'll probably say it's acceptable. It could be better if you use unpacking instead of indexing though, as others have pointed out.


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

Search: