Hacker News new | ask | show | jobs
by chillpenguin 1177 days ago
I agree. But regarding

> I can't think of many more elegant ways to convert a list of ints to floats, in any language, than `[float(i) for i in integerlist]`.

I think something like `integerlist.map(float)` is at least a contender.

1 comments

I prefer the python syntax generally, but throw in some typing with Typescript inferring the post-map type from the map function's return type, and I'd definitely go with `integerlist.map(float)`