Ad
  • Custom User Avatar

    Hi,

    Just a suggestion but the tests may need to include cases other than "foo". Seem like I was able to hardcode it and still pass all the tests.

  • Custom User Avatar

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

  • Custom User Avatar

    This was a great kata, overall.

    But I would definitely write up some more tests that include other classes being inherited by base classes.

    for example.

    class Person(metaclass = Meta):
        def __init__(self, name):
            self.name = name
    
        def getName(self):
            return self.name
    
    class Bob(Person):
        def __init__(self):
            self.n = 1
            super().__init__('Bob')
    
        def bob_get(self):
            return self.n
    
    
    b = Bob() # should register two __init__ calls
    b.a = 2 # set
    b.a # get
    b.bob_get() # get for 'n' along with get for method call and method call itself
    

    There is a solution that passes your tests but doesn't pass this one so I had to improve the solution.

    So to prevent the incomplete or incorrect code from passing and making this kata a bit more complete, I would add up those tests.

    Regardless of that - Excellent stuff!

  • Custom User Avatar

    Excellent kata, kudos!

    I'd like to suggest adding a test case such as:

    test.assert_equals(find_uniq([ 'ab', 'ba', 'abc']), 'abc')

    Reason: That was the only test my code couldn't pass. My solution was based on unordered "startswith." So to prevent solutions akin to mine from passing, adding the above test case would be ideal.
    Plus, the assert with "the first element" should be a little mixed because, in that case, my broken code wouldn't be able to work either.
    e.g.
    test.assert_equals(find_uniq([ 'ba', 'cbc', 'ccb', 'bcc']), 'ba')
    Having fixed all the bugs in my code, I just wanted to let you know about the lack of test cases I spotted in this kata. I hope you appreciate my comment. Kind regards

  • Custom User Avatar

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

  • Custom User Avatar

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