Skip to content

Commit

Permalink
Replace list()/dict() with literals
Browse files Browse the repository at this point in the history
Literals are always faster and conventional in modern Python style.
  • Loading branch information
jdufresne committed Nov 2, 2022
1 parent 62bd5ce commit 44af73d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class NewlineHelpFormatter(argparse.HelpFormatter):

def _split_lines(self, text, width):
parts = text.split('\n')
out = list()
out = []
for part in parts:
# Eventually we could allow others...
indent_start = '- '
Expand Down Expand Up @@ -400,7 +400,7 @@ def parse_options(args):
config = configparser.ConfigParser(interpolation=None)

# Read toml before other config files.
toml_files_errors = list()
toml_files_errors = []
if os.path.isfile('pyproject.toml'):
toml_files_errors.append(('pyproject.toml', False))
if options.toml:
Expand Down Expand Up @@ -834,7 +834,7 @@ def main(*args):
dictionaries = options.dictionary
else:
dictionaries = ['-']
use_dictionaries = list()
use_dictionaries = []
for dictionary in dictionaries:
if dictionary == "-":
# figure out which builtin dictionaries to use
Expand All @@ -858,7 +858,7 @@ def main(*args):
parser.print_help()
return EX_USAGE
use_dictionaries.append(dictionary)
misspellings = dict()
misspellings = {}
for dictionary in use_dictionaries:
build_dict(dictionary, misspellings, ignore_words)
colors = TermColors()
Expand Down

0 comments on commit 44af73d

Please sign in to comment.