Skip to content

Commit

Permalink
update Unique docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tandav committed Nov 12, 2023
1 parent cfe0b72 commit 40039db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,9 @@ namespace()
>>> ['a', 'cd', 'cd', 'e', 'fgh'] | Unique(len) | Pipe(list)
['a', 'cd', 'fgh']

>>> [{'a': 1}, {'a': 2}, {'a': 1}] | Unique(operator.itemgetter('a')) | Pipe(list)
[{'a': 1}, {'a': 2}]

```

## Exec
Expand Down
1 change: 1 addition & 0 deletions tests/pipe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ def test_methodcaller():
(range(10), lambda x: x % 3, [0, 1, 2]),
(['a', 'cd', 'cd', 'e', 'fgh'], None, ['a', 'cd', 'e', 'fgh']),
(['a', 'cd', 'cd', 'e', 'fgh'], len, ['a', 'cd', 'fgh']),
([{'a': 1}, {'a': 2}, {'a': 1}], operator.itemgetter('a'), [{'a': 1}, {'a': 2}]),
],
)
def test_unique(seq, key, expected):
Expand Down

0 comments on commit 40039db

Please sign in to comment.