Issues (1445)

pincer/utils/replace.py (3 issues)

1
# Copyright Pincer 2021-Present
0 ignored issues
show
Missing module docstring
Loading history...
2
# Full MIT License can be found in `LICENSE` at the project root.
3
4
from typing import Any, Callable, Iterable, List, T
5
6
7
def replace(
0 ignored issues
show
Missing function or method docstring
Loading history...
8
    func: Callable[[Any], bool], iter_: Iterable[T], new_item: T
0 ignored issues
show
Wrong hanging indentation before block (add 4 spaces).
Loading history...
9
) -> List[T]:
10
    return [item if func(item) else new_item for item in iter_]
11