Ad
  • Custom User Avatar

    I feel like this kata is just... not that interesting. It doesn't really teach anything about ASTs per se. After all, the error you get is incredibly Python specific. In particular, the requirement for line numbers is an implementation detail that has nothing to do with what ASTs are, or what you can do with them.

    Beyond that, this kata is solveable with a quick scan of the documentation or a google search, and all it teaches is... Python AST nodes need line numbers. Woopdidoo.

    Finally, this kata feels impossible to rate. In terms of true difficulty, it would be a white kata. But the domain is most certainly outside the knowledge requirements for beginners, so it has to be yellow. Either feels wrong.

    Don't get me wrong, I like the idea of exploring the concept of ASTs, even if it's limited to just Python, but this feels more like "I encountered this error once, and now I'm going to make it part of this kata series, because I can't think of anything more interesting".

  • Default User Avatar

    def multiply(a,b):
    result = a*b
    return result
    res = multiply (5,10)
    print(res)

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

    def multiply(a, b):
    return a * b

  • Default User Avatar

    I thought about doing it this waay but had no idea how to implement it in haskell, nice work!

  • Custom User Avatar

    it is, but 0 can be counted as False

  • Custom User Avatar

    aaa.... right.... how on earth did I not notice that formal is s'posed to be a bool/

  • Default User Avatar
  • Custom User Avatar

    Description is not consistent:

    You will write a function describe taking a function's source code source as input, and will use Python's AST to grab information about it.
    describe_fn will return an object: ....

    The function name is describe_fn in the tests/solution, not describe.
    Besides, what we're returning is a dict, not some object.

  • Custom User Avatar

    Sample Tests expect a body key in the returned dict, test suite does not. If the key is included (simply with the input source as value), it fails random tests because those compare dict equality. If not included, sample tests error out.

  • Custom User Avatar

    I don't think that's an issue. It's more work than the expected solution, so considering the probable rank of the kata, it's fine.

  • Custom User Avatar

    Hi,

    The arguments names could be etracted in various ways and:

    • list makes the order relevant => should be a set (or if you want to keep the old solutions valid, you can add to the description that the order won't be relevant, then you transform the vlist to a set inside the tests
    • it's not specified what kind of arguments should be covered or not ("all" is a valid answer, "only ...3 is also a valid answer, but that has to be specified in any case):
      • posonlyargs?
      • args?
      • vararg?
      • kwonlyargs?
      • kw_defaults?
      • kwarg?

    Cheers

  • Custom User Avatar

    There's another instance to correct in the Instructions section of the description...
    "You will write a function describe taking a function's source code..."

    Really enjoyed this kata though, thanks!

  • Custom User Avatar

    I don't see how that should prevent the kata from approving. It's not like this results in an exploit of a high level kata. I wouldn't worry too much about such solutions on an easy kata.

  • Loading more items...