Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
a man's gotta do what a man's gotta do...
Edit: However, you have got a point. Check out my fork, by inheriting from
float
the code becomes significantly shorter (while still being equally correct, and tongue-in-cheek).Best, MFreidank
This comment is hidden because it contains spoiler information about the solution
Hi! Thanks for your comment and for helping me improve my kata.
I just changed the example tests and your issue should now be resolved.
If anything else (still?) looks wrong, please comment again!
Best,
MFreidank
Pep8 says:
"Comparisons to singletons like None should always be done with is or is not, never the equality operators."
https://www.python.org/dev/peps/pep-0008/#programming-recommendations
How is this "best practices"? It is a clever hack indeed, but
the people who upvoted this for best practices are asinine to me.
"Explicit is better than implicit."
Line 2 of PEP8:
https://www.python.org/dev/peps/pep-0020/
if (true) {
return true;
} else {
return false;
}
??
Could
be changed to
?
Or would this break in a way I'm missing?
Because special friends may change, more quickly than one thinks!
Valid point indeed!
In what world is this best practice? Very clever indeed, but if anyone puts this in production code, I'm killing myself.
Glad you profited! Coming from a background of functional programming myself, I share your sentiments.
That's why I decided to make a few katas to become more acquainted with all the class magic.
So be on the lookout for more similar stuff coming soon ;)
Your solution does not make sanity checks on assignments to variables "length, height, width, weight".
The test suite did not check for this, so it passed, but I just updated the test suite to reflect this requirement.
Please resubmit a solution that adresses this!
Best,
MFreidank
Thanks! :)
Good catch! I missed that case completely in my test suite :(
Test suite is updated and your solution has been invalidated.
Please resubmit a solution covering this case.
Thanks for helping me make the kata better.
@suic: your solution still passes, so no worries on your part ;)
Loading more items...