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

two_fer: sync with canonical data #1806

Merged
merged 1 commit into from
May 31, 2019
Merged

Conversation

Grociu
Copy link
Contributor

@Grociu Grociu commented May 31, 2019

part of #1762

  • changed the argument of test function to None from empty string.
  • rewritten the example to fit the new test

@Grociu Grociu requested a review from a team as a code owner May 31, 2019 16:06
@@ -1,5 +1,5 @@
def two_fer(name=""):
if not name.strip():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer worked with None as the argument for test_no_name_given

@@ -7,7 +7,7 @@

class TwoFerTest(unittest.TestCase):
def test_no_name_given(self):
self.assertEqual(two_fer(), 'One for you, one for me.')
self.assertEqual(two_fer(None), 'One for you, one for me.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per canonical data switched null to None as this is the equivalent.

@cmccandless cmccandless merged commit 5694c47 into exercism:master May 31, 2019
@cmccandless
Copy link
Contributor

Merged; thanks for working on this!

@Grociu Grociu deleted the two-fer-sync branch May 31, 2019 18:16
@yawpitch
Copy link
Contributor

yawpitch commented Jun 1, 2019

I'm going to say this change should not have been made.

It makes no sense to force students two write an entirely un-Pythonic solution due to what is effectively an oversight in the canonical data. It is insensible to make a two_fer(None) call rather than a two_fer() call when attempting to teach default arguments, as the default argument can never be involved with the tests as rewritten.

@SleeplessByte
Copy link
Member

FWIW: None might be equivalent to null when that null is JavaScript, but I would say that normally we would have used undefined in the JS equivalent of this canonical data. null from JSON doesn't blindly translate.

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.

4 participants