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

That list comprehension though. Could be useful to math-fluent newcomers.


What list comprehension? I don't see any.

Besides, python list comprehension isn't that far from the mathematical version. Compare:

{ x^2 : x in Z, x^2 > 10 }

with

[ x^2 for x in Z if x^2 > 10 ]

The main problem is that you can't have a list of all positive integers, so you're kind of forced to make it a generator instead. And the standard set notation clashes a bit with the notation of dictionaries, but on the whole it's not that bad.


It's there at the first defined function.

$$any(code \notin api\_codes \forall code \in codes)$$




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: