steemit / steem-python

The official Python (3) library for the Steem Blockchain.
https://steem.io
MIT License
153 stars 98 forks source link

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

Closed theoreticalbts closed 7 years ago

theoreticalbts commented 7 years ago

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.

goldibex commented 7 years ago

great minds think alike, thanks!!!