Skip to content

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