Skip to content

Rewrite dictionary.py so it doesn't make grep explode#85

Merged
theoreticalbts merged 1 commit intomasterfrom
2017-10-23-dictionary-split-line
Oct 30, 2017
Merged

Rewrite dictionary.py so it doesn't make grep explode#85
theoreticalbts merged 1 commit intomasterfrom
2017-10-23-dictionary-split-line

Conversation

@theoreticalbts
Copy link
Copy Markdown
Contributor

When grepping around the codebase, often a result will be found in dictionary.py and then it attempts to display a 300kb long line, which makes it hard to tell whether there are relevant results before/after.

This patch refactors dictionary.py to put each word on its own line, and then replaces the resulting newlines with commas to retain compatibility.

You can test the validity of the patch by making a small program called testwords.py:

#!/usr/bin/env python3
from dictionary import words
print(words)

Since running ./testwords.py | sha256sum before and after this patch results in the same value of f997b67f88f8928126cb73bc927c23ed830fccb62adba6b0d871804952011a01 we can be sure the two versions are equivalent.

When grepping around the codebase, often a result will be
found in dictionary.py and then it attempts to display a
300kb long line, which makes it hard to tell whether there
are relevant results before/after.

This patch refactors dictionary.py to put each word on its
own line, and then replaces the resulting newlines with
commas to retain compatibility.
@goldibex
Copy link
Copy Markdown
Contributor

great minds think alike, thanks!!!

@theoreticalbts theoreticalbts merged commit 0bee1cb into master Oct 30, 2017
Dont-Copy-That-Floppy pushed a commit to Dont-Copy-That-Floppy/steem-python that referenced this pull request Feb 23, 2025
…t-line

Rewrite dictionary.py so it doesn't make grep explode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants