3 ms·
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. ```goss
by pantsforbirds 3mo 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.
- mkl 3mo agoAlso the Python sorts by string content and the Gossamer sorts by string length.