Skip to content

Commit 1d9ca12

Browse files
committed
chore: rewrite filter to list comprehension to satisfy mypy
seems to be a bug in mypy, see python/typeshed#6140 Signed-off-by: GRBurst <[email protected]>
1 parent e01edc7 commit 1d9ca12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

slack_logger/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def format_blocks(self, record: LogRecord) -> Sequence[Optional[Block]]:
4141
def format(self, record: LogRecord) -> str:
4242
maybe_blocks: Sequence[Optional[Block]] = self.format_blocks(record=record)
4343
print(f"Maybe blocks: {maybe_blocks}")
44-
blocks: Sequence[Block] = list(filter(lambda b: b is not None, maybe_blocks))
44+
blocks: Sequence[Block] = [b for b in maybe_blocks if b is not None]
4545
print(f"blocks: {blocks}")
4646
str_blocks: str = json.dumps(list(map(lambda block: block.to_dict(), blocks)))
4747
print(f"str_blocks: {str_blocks}")

0 commit comments

Comments
 (0)