[Python-announce] friendly-sequences-1.2.0 released
Artem Zhukov <[email protected]> Thu, 18 Apr 2024 18:27:13 +0200
| Newsgroups | gmane.comp.python.announce |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
For those, who like functional programming, this library [1] provides the following way of functional composition:
```python
from friendly_sequences import Seq
assert (
Seq[int]((1, 2))
.zip(Seq[int]((3, 4)))
.flat_map(lambda x: x + 1)
.filter(lambda x: x != 2)
.sort()
.map(str)
.fold(lambda left, right: f"{left}{right}", "")
) == “345"
```
It depends only on "attrs>=21.3.0”
[1] https://github.com/zhukovgreen/friendly-sequences
--
zhukovgreen,
Data Engineer @Paylocity
https://github.com/zhukovgreen
_______________________________________________
Python-announce-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: [email protected]