Beta
Pokémon Types [Pokémon OOP #1]
14ffdevv
Loading description...
Object-oriented Programming
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.
It is not tested that the instance attribute is really defined as
name
, only accidentally (because part of random tests explode if it isn't)IMHO the fact that the tests (which are not random) failed with this exact message
AttributeError: 'PokemonType' object has no attribute 'name'
in casename
was not implemented clearly mean that the thing is tested for, and this should be marked as a Suggestion, not an issue. Btw I now have added 2 more explicit test cases.Hi,
Are you sure about that...?
I guessit's the same with the full test suite?test.expect
unless you provide a useful error message. Tip: just usetest.assert_equals
...DefaultType
are never explained anywhere (that's full specs. The user shouldn't have to guess what's on your mind)Cheers
Hi, this time (to answer the "...again") I don't think you nail any real point tbh.
"Normal": {"Ghost": 0}
i.e. "Normal" does 0 damage to "Ghost".test.expect
nortest.assert_equals
without error description in the internal test case. If you found some other type of misleading error description please provide me something to watch for and I'll fix ittest.expect(PT.get("Ghost").is_immune_to("Normal"))
in the sample tests where users can add/comment out/edit as they need to (if they actually experience errors) is perfectly fine, readable and clear. I also don't thinktest.assert_equals
was properly used, as per your observation, since it missed the verbose description. I've still added message description for every error (bothexpect
andassert_equals
) in the example test case, althought they make the test case code box less clean and more annoying to edit for the users imo, but whatever.DefaultType
was declared this wayDefaultType = TypeVar("DefaultType")
meaning 'DefaultType is a generic type with name "DefaultType"'. I've still changed it toDefaultType = TypeVar("T")
to be even more clear that it's just a generic type used to specify that the return type ofget
should be eitherPokemonType
or any type thedefault
param is. I think that what's on my mind is also on the initial solution, so it doesn't really need to be verbosely explained. Do you really think I should explain this inside the description?PS I still wait for your response to mark the issue as solved
@test.desribe
&@test.it
decorator. I realize now you mixed this up with the assertion thing (which is also a problem, but not the same. My mistake again).test.expect
in the example tests, they will assume the invisible tests will be written that way. That doesn't encourage in thinking they'll have a good experience with the kata.ATTACK_MULTIPLIERS
so it is consistent that it contains details from an attacking POV. Flying attacks Ground with 1x damage (nothing to specify), while Ground attacks Flying with a 2x damage. This is not always the case that if Type_A does 2x dmg Type_B then Type_B does 0.5x dmg Type_A.test.expect
something) of the testing suite:ok:
I'm pretty sure your Bug/Fairy multipliers are wrong. I'm doing my own implmentation of the multiplier and only failing on Bug/Fairy comparisons. Check to see if your're missing something or have incorrect values.
Also: Bug/Dark.
Nice catch, pretty coherent the bugs were in the Bug isn't it? Fixed, thank you. I have also double checked others and didn't find any additional error.
AttributeError: 'PokemonType' object has no attribute 'name'
It doesn't say in the description that we need to store the name as an attribute, only implement the methods.
This comment has been hidden.
Mb, added in the description and fixed a broken test not accounting for it, should be trivial to adapt the solution
Is it 6 kyu appropriate iyo?
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Oh yeah duh, I didn't even think how dict recognizes keys in python. xD
I even used it myself to use list as keys sometimes. x)
Sorry, but this isn't how it should be done. Specifications should be in the kata description. A user shouldn't have to click the train button to uncover what they need to do.
Done. Just trimmed the type details.