Ad
  • Default User Avatar

    I gave up and look at the others'solution .

    Surprise : the second one is very similar to mine

    Strange !

  • Default User Avatar

    Hi

    I'm waiting for the python version to rank this kata , but IMHO it must be approximatively ranked as part II.
    A bit more complex, but same mechanisms are involved.

  • Default User Avatar

    Hi

    No indications about the number of random tests : timed out with 100 passed tests ?

  • Default User Avatar

    Hi
    didn't know this sum function on lists , need to explore

  • Default User Avatar

    Forget, passed after rereading
    Sorry

  • Default User Avatar

    Hi

    sorry, but unable tu understand the results of the task "buy" even with the tries of explanation below :

    when you begin with harvested apple and buy orange , have you only orange at this moment or apple+orange in your stock ?

  • Default User Avatar

    A random tests on negative rounded values failed. Another try with same code has been successfull.
    I saw that it was already previously araised, and recently annouced as solved.
    Still an issue ?

  • Default User Avatar

    Why not. Pls could you write a solution corresponding to your proposal

  • Default User Avatar

    Hi ,

    just a remark about the desciption : as you clearly separate 2 cases : a==0 and a!=0, y'are not obliged to repeat if a==0 for the different subcases in the first case

  • Default User Avatar

    Hi
    I understood that in case of equality in damages between 2 weapons we have to select the first in alphabetic order ,
    with python I got an error with that order and no error with the reverse alphabetic order

  • Default User Avatar

    c'est bien ce que j'avais cru comprendre :)

  • Default User Avatar

    with a little help from ChatGPT , I succeeded to obtain the result I wanted with a 2-stairs implementation of closure , one for the class and yours called by the first one

    import inspect
    def method_logger(method): 
        def wrapper(self, *a, **kw):
            call   = method.__name__ if method.__name__!='__init__' else self.__class__.__name__
            args   = ''.join( f', {v!r}' for v in a)
            kwargs = ''.join( f', {k}={v!r}' for k,v in kw.items() )
            print(f"{call}(self{args}{kwargs})")
            return method(self, *a, **kw)
        return wrapper
    
    def class_logger(classe):
        for method_name, method in inspect.getmembers(classe, inspect.isfunction):
            setattr(classe, method_name, method_logger(method))
        return classe
    
    @class_logger
    class Atom(object):
    
    
    

    what do you think of the result ?

    without any connection : why did you use the term 'frenglish' in the discussions below ?

  • Default User Avatar

    not at ease with decorators.

    must dig

  • Default User Avatar

    thanks for this generic helpfull closure.

  • Default User Avatar

    Thanks for the quick answer.

    Simple concept, never used before on my side, but efficient, that takes more time than a simple print, especially to identify specifically both called methods and arguments.

    I'm just at the beginning of this very funny kata, as an objects' fan I appreciate a lot.

    At first I was trying to find more examples to see how atoms, added outside of branches are treated, especially how to deal with their id after the molecule's unlocking, but I had forgotten the possible use of the attribute atoms to memorize the creation's order.

  • Loading more items...