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

Changed lab 2 - question 4b testcases to unicode strings. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Jabokoe
Copy link

@Jabokoe Jabokoe commented Jul 12, 2015

The RDD the student specified 'removePunctuation()' function will be used on contains unicode strings.
This test (4b) used default type strings, causing implementations of removePunctuation that use '.translate()' to pass this test.
However '.translate()' does not behave well for unicode strings, which cause cryptic errors later down the line (4c).
Aditionally positive test results for 4b wil confuse students debugging errors at 4c.
Changing the testcases to unicode strings better guides students towards using the regular expressions (re) module for answering question 4b.

The RDD this function will be used on contains unicode strings.
This test uses default type strings, causing implementations of removePunctuation that use string.translate() to pass this test.
However string.translate() does not behave well for unicode strings, which cause cryptic errors later down the line (4c).
Aditionally positive test results for 4b wil confuse students debugging errors at 4c.
Changing the testcases to unicode strings better guides students towards using the regular expressions (re) module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant