Hacker News new | ask | show | jobs
by pantsforbirds 35 days ago
I'm fairly sure the code snippets aren't equal in the last python example:

```python names = sorted({name.lower() for name in users if name}) ```

vs.

```gossamer let names = users |> iter::filter(|n: String| n.len() > 0) |> iter::map(|n: String| n.to_lower()) |> iter::sort_by_key(|n: String| n.len()) ```

Python is sorting a set (unique values only), but I'm not seeing a unique or set approach for gossamer.

1 comments

Also the Python sorts by string content and the Gossamer sorts by string length.