Skip to content

Commit

Permalink
Merge pull request #1721 from PyCQA/itertools-chain
Browse files Browse the repository at this point in the history
replace some unnecessary itertools.chain with *splat
  • Loading branch information
asottile committed Oct 27, 2022
2 parents 4272ade + 1745fd4 commit 7dfe996
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
5 changes: 1 addition & 4 deletions src/flake8/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import argparse
import collections
import errno
import itertools
import logging
import multiprocessing.pool
import signal
Expand Down Expand Up @@ -80,9 +79,7 @@ def __init__(
"physical lines": 0,
"tokens": 0,
}
self.exclude = tuple(
itertools.chain(self.options.exclude, self.options.extend_exclude)
)
self.exclude = (*self.options.exclude, *self.options.extend_exclude)

def _process_statistics(self) -> None:
for checker in self.checkers:
Expand Down
11 changes: 4 additions & 7 deletions src/flake8/style_guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import copy
import enum
import functools
import itertools
import logging
from typing import Generator
from typing import Sequence
Expand Down Expand Up @@ -221,12 +220,10 @@ def __init__(
self.default_style_guide = StyleGuide(
options, formatter, self.stats, decider=decider
)
self.style_guides = list(
itertools.chain(
[self.default_style_guide],
self.populate_style_guides_with(options),
)
)
self.style_guides = [
self.default_style_guide,
*self.populate_style_guides_with(options),
]

self.style_guide_for = functools.lru_cache(maxsize=None)(
self._style_guide_for
Expand Down

0 comments on commit 7dfe996

Please sign in to comment.