Ad
  • Custom User Avatar

    Admittedly what I'm about to say is a border case and not reporting a bug: I can't help but see a way to have passing functions break, after the following procedure:

    subclass the list class, break it somehow; put an instance of that object in your dataframe and suddenly the function no longer works.
    For example:

    class TrickyList(list):
        def __iter__(self): 
            pass
            
    tl = TrickyList()
    print(isinstance(tl, list)) # True
    tricky_df = pd.DataFrame(data=[[tl,5], [77, 3]], 
                            columns=list('AB'))
    flatten(tricky_df, 'A') # TypeError: iter() returned non-iterator of type 'NoneType'
    

    OK, that was just me having fun with an edge case...

  • Custom User Avatar

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

  • Default User Avatar

    yeah that's embarassing
    corrected thks

  • Default User Avatar
  • Default User Avatar
  • Default User Avatar

    given that all pirates want as big a share of the treasure as possible, there is a forced equilibrium.
    will make it clearer, thanks for the feedback

  • Default User Avatar

    I think they are to most people indeed, I just have a few weeks only of Python (and any form of code actually
    ) behind me and know decorators for a few hours...

  • Default User Avatar

    I have but still can't manage to push the kata
    I struglle differentiating my solution func to user's func

    could you pls have a look? it's published in beta

    thks

  • Default User Avatar

    hi XRFXLP,

    thanks for your quick reply.
    I have completed correctly all parts of the kata except the testing parts.

    As I don't master enough the testing framework, I ran into various errors when testing. What makes it difficult among other things is that in my reference_func, I have several functions so I'm lost with the decorators.
    I also do not understand well the structure of the packages (codewars_test, solution) and how I'm supposed to use these.

    The kata is called Pirates and bullions treasure puzzle, can you see it?

  • Default User Avatar

    Hi all,

    I am creating my first kata and am struggling with the testing part, especially using the decorators and making random cases. I checked the github and codewars docs but not much is said about the that, at least not enough for me.
    Could someone please help me validate my kata by explaining me the detailed way to have working test cases?

    Thanks,

  • Custom User Avatar

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

  • Default User Avatar

    I fully agree.
    I have not solved it yet (nor have I given up, though), yet I managed the related kata asking for the last digit of a^b.
    Like you I searched extensively on the web for algos such as modular exponentiation, but I doubt this is the expected method.