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

Refactor and fix class method generate_cjk #20

Merged
merged 4 commits into from
May 17, 2014
Merged

Refactor and fix class method generate_cjk #20

merged 4 commits into from
May 17, 2014

Conversation

Ichimonji10
Copy link
Contributor

Refactor method with the intent of making it easier to understand. The method is
now shorter (6 LoC instead of 12) and has more descriptive variable names.

Also fix a minor bug. Formerly, the method would never return the character with
codepoint 0x9FCC, which is at the upper limit of the CJK character set.

Refactor method with the intent of making it easier to understand. The method is
now shorter (6 LoC instead of 12) and has more descriptive variable names.

Also fix a minor bug. Formerly, the method would never return the character with
codepoint 0x9FCC, which is at the upper limit of the CJK character set.
Use `random.randint` instead of `random.randrange`. The former returns a number
N where `a <= N <= b`.
Add method `generate_utf8`, which returns a string composed randomly from the
entire set of UTF-8 characters. Update method `generate_string` so that it calls
`generate_utf8` and `generate_cjk` when asked for a "utf8" or "cjk" string,
respectively.

Update docstring for method `generate_string` to reflect these changes.
@omaciel
Copy link
Owner

omaciel commented May 17, 2014

ACK and Roll

omaciel added a commit that referenced this pull request May 17, 2014
Refactor and fix class method `generate_cjk`
@omaciel omaciel merged commit 179d4c8 into omaciel:master May 17, 2014
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.

None yet

2 participants