Skip to content

Commit

Permalink
Cleaner list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasst committed Jun 27, 2024
1 parent 6c093de commit 94aeb01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions quotequail/_patterns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import functools
import operator
import re

REPLY_PATTERNS = [
Expand Down Expand Up @@ -102,9 +100,11 @@
"forward": [re.compile(regex) for regex in FORWARD_PATTERNS],
}

COMPILED_PATTERNS: list[re.Pattern] = functools.reduce(
operator.iadd, COMPILED_PATTERN_MAP.values(), []
)
COMPILED_PATTERNS: list[re.Pattern] = [
pattern
for patterns in COMPILED_PATTERN_MAP.values()
for pattern in patterns
]

MULTIPLE_WHITESPACE_RE = re.compile(r"\s+")

Expand Down

0 comments on commit 94aeb01

Please sign in to comment.