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

In this instance, I'm pretty confident the generator version is just a better phrasing. It's shorter, contains no mutable state to get wrong, is Pythonic, and can instantly be made lazy by replacing the square brackets with round ones.

`[p for p in permutations(numbers) if primePairs(p)]`



This would have been a better original comment than just calling the solution in the blog post "ghastly".


I retract what I said. You were right.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: