Beta

It's Magic

Description
Loading description...
Metaprogramming
  • Please sign in or sign up to leave a comment.
  • anthono Avatar

    Instructions are unclear and vague:

    "magic_ - a special property as it should be able to handle numbers given with it" should write "magic_ - special instance and its property is being able to handle numbers given with it"and since it has and underline its not a public but private instance. "whereami" is also instance and "whoami" is also instance.

  • Voile Avatar

    This comment has been hidden.

  • Awesome A.D. Avatar

    No random tests.

  • Awesome A.D. Avatar

    Instances of classes, which have Magic objects as class attributes, should have a magic property

    I'm not quite OK with the wording here; it implies the instances should have magic properties, while in reality users will most likely make this a class attribute/property. It's a subtle difference (mind you, you could indeed apply this as a property on the instance, but that's alot more complicated)

  • Awesome A.D. Avatar

    The tests declare classes via class Name(object), which is incredibly anachronistic. This ain't 1999, we're not writing Python 2, nor are we trying to be compatible with Python 2, savvy? :)

    • chr3st5an Avatar

      I do that for aesthetic reasons... However, you can for sure explain me why this is a big issue and how it makes the kata unsolvable

      Issue marked resolved by chr3st5an 3 years ago
    • Awesome A.D. Avatar

      Aesthetic? You aren't serious, right? Well, that's subjective I suppose.

      You're right, this isn't issue worthy, it should arguably have been a suggestion. However, it's not as "arbitrary" as you seem to make it out to be. Programmers who've been using Python since the Python 2 days will see this and instantly double check to see whether the code they're looking at is actually Python2. In Python 3, class Foo and class Foo(object) are the same thing, in Python 2 they are not. Because the semantics differ across versions, it's idiomatic to use the current declaration style for the version you're writing in (and yes, there's still tons of Python 2 code out there, still being maintained). At best, you're confusing a few old-timers. At worst, you're setting a bad example for newbies.

    • chr3st5an Avatar

      I do that for aesthetics and I am serious.

      CodeWars only supports py3.8 / py3.10 and the predefined solution is written in that particular style. So in this frame / context it is as "arbitrary" as it is. And I am 100% sure that nobody gets confused.