Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 62-docs-expand-prior-…
Browse files Browse the repository at this point in the history
…art-with-fluid
  • Loading branch information
MartinBernstorff committed Jan 1, 2024
2 parents 4d509e1 + e5d46ed commit b7abd1a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@



## v0.15.1 (2024-01-01)

### Fix

* fix: .flatten should not flatten strings

Fixes #60 ([`7723d07`](https://github.com/MartinBernstorff/FunctionalPy/commit/7723d0779713a761a8d5e47f674dfa28f693adc6))

### Unknown

* fix flatten should not flatten strings (#63) ([`f10d6ca`](https://github.com/MartinBernstorff/FunctionalPy/commit/f10d6ca65e5c798135b8f718828983b46e273793))

* Merge remote-tracking branch 'origin/main' into 60-fix-flatten-should-not-flatten-strings ([`866cd47`](https://github.com/MartinBernstorff/FunctionalPy/commit/866cd47c492d8b35759b399efe79a9c81359cc3b))

* Update README.md ([`ca1ae38`](https://github.com/MartinBernstorff/FunctionalPy/commit/ca1ae3852099f40bfeb8b2e4d80f9e21f4047458))


## v0.15.0 (2023-12-31)

### Feature
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ You get this 🔥:
```python
result = (Seq([1,2,3])
.map(multiply_by_2)
.filter(is_even)
)
.filter(is_even))
```

Instead of this:
Expand Down
2 changes: 1 addition & 1 deletion functionalpy/_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def flatten(self) -> "Seq[_T]":
values: list[_T] = []

for i in self._seq:
if isinstance(i, Sequence):
if isinstance(i, Sequence) and not isinstance(i, str):
values.extend(i)
else:
values.append(i)
Expand Down
2 changes: 1 addition & 1 deletion functionalpy/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_flatten_str(self):
test_input: list[str] = ["abcd"]
sequence = Seq(test_input)
result: Seq[str] = sequence.flatten()
assert result.to_list() == ["a", "b", "c", "d"]
assert result.to_list() == ["abcd"]

def test_flatten_includes_primitives(self):
test_input: list[int | list[int]] = [1, [2]]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "functionalpy"
version = "0.15.0"
version = "0.15.1"
authors = [{ name = "Martin Bernstorff", email = "martinbernstorff@gmail.com" }]
description = "functionalpy"
classifiers = [
Expand Down

0 comments on commit b7abd1a

Please sign in to comment.