Beta
It's Magic
Loading description...
Metaprogramming
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
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.
This comment has been hidden.
Heya,
I see,... you found other magic methods š However
inspect
should be now banned.No random tests.
Yeah,
I didn't include random tests because I think that it actually takes longer to "cheat" than to just implement that class.
Nah. I can just submit, look at the error/stack trace, implement missing stuff, repeat. Easy points. Random tests make this impossible.
Hmm kinda,
I added some random numbers.
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)Uh yeah,
you are right. That was my intention in the first place but I forgot the most obvious again 𤦠Gonna change that description later, thx m8
ć ¤
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? :)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
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
andclass 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.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.