Ad
  • Default User Avatar

    It also works perfectly in the reverse case of interpretation.

  • Custom User Avatar

    you updated the description, but not the tests. So the feedback is still as bad as before:

      default argument is an empty list
      Log
      ([0],)
      Function must have a single argument with '[]' as default'
    
    • note that your tests are logging stuff (they shouldn't)
    • my function is still having [] as default argument but the test is failing without actually telling why.
  • Default User Avatar
  • Custom User Avatar

    This issue isn't actually resolved as long as the test feedback isn't actually correct/appropriate... ;)

  • Custom User Avatar

    I know this is incorrect, what I'm saying is that this code passes the sample tests. It shouldn't.

  • Default User Avatar

    If a list is provided (even empty) it should also be returned, so this is incorrect. I'll update the description to make it clearer.

  • Default User Avatar

    Ok, I understand what you mean now. Your solution is failing because you're actually mutating the default list, so it ends up as [0]. I could change the tests to only look at signature, but that's not really what I'm going for with this kata. Your solution will work if you slightly tweak it.

    Also, you're returning the same default instance when called with no argument, which is not the intended behavior. This is currently missing from the tests though.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    That's the thing: I have no idea why this test isn't passing because my code is following the specs of that test. And since I didn't pass the tests because of that one, I cannot see your code/tests so I have no idea.

    Note that this means your second test isn't actually checking what it announced, but something related and "wider" instead.

    EDIT: yes, about the last part.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    note: typo in the first message: read meaning the WAY you're checking

  • Custom User Avatar
    Function must have a single argument with '[]' as default'
    

    Hi,

    The above is utterly wrong as a sepcification. The sensical way to handle what the kata is asking for would be... see spoiler message below.

    And this is even worse (I get that one on the second test. The previous was on the third):

    Function must have a single argument with '[]' as default'
    

    while this is in my code: def append_zero(lst=[]):, meaning the why you're checking for this is incorrect.

    Cheers

  • Default User Avatar

    Added some basic random tests

  • Default User Avatar

    It was poorly worded, should be more accurate now.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...