Ad
  • Custom User Avatar

    I updated the Python test suite so now all cases should be covered.

  • Custom User Avatar

    It says greater, not better. It's clear imo.

  • Custom User Avatar

    I forgot to update the tests after changing the actual tests. Thanks for warning me, it's fixed now.

  • Custom User Avatar

    This would involve knowledge about basic Python language features. Please be more familiar with the language before attempting code golf challenges ;-)

  • Custom User Avatar

    In the end, it has to do with how you define the index out of bonds situation.

    Yes, and they're well defined in the kata's description last two examples:

    helper.page_index(20) # should == -1
    helper.page_index(-10) # should == -1 because negative indexes are invalid
    
  • Custom User Avatar

    In python it's natural to use negative indexing...

    ... into containers, using the [] access notation (__getitem__). But this is a custom method. There is no obvious correlation between the two, which is to say that your intuitions/assumptions are simply wrong.

  • Custom User Avatar

    So what? The model is the same for all languages, if some language has negative indexing it doesn't mean you should change it for no reason. Not a kata issue.