3 ms·
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 c
by Smaug123 6y ago
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)]`
- djur 6y agoThis would have been a better original comment than just calling the solution in the blog post "ghastly".
- throwaway_pdp09 6y agoI retract what I said. You were right.