Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call sum() without an intermediary list following PEP 289 recommendations #129

Merged
merged 1 commit into from Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion charset_normalizer/cd.py
Expand Up @@ -324,7 +324,7 @@ def coherence_ratio(
sequence_frequencies = Counter(layer) # type: Counter
most_common = sequence_frequencies.most_common()

character_count = sum([o for c, o in most_common]) # type: int
character_count = sum(o for c, o in most_common) # type: int

if character_count <= TOO_SMALL_SEQUENCE:
continue
Expand Down
2 changes: 1 addition & 1 deletion charset_normalizer/md.py
Expand Up @@ -538,7 +538,7 @@ def mess_ratio(
if (
index > 0 and index % intermediary_mean_mess_ratio_calc == 0
) or index == length - 1:
mean_mess_ratio = sum([dt.ratio for dt in detectors])
mean_mess_ratio = sum(dt.ratio for dt in detectors)

if mean_mess_ratio >= maximum_threshold:
break
Expand Down