v01d-cypher/kgs_league_scorer — pull request #1 by ejmr (2013-08-30 02:51:39+00:00)
Title: Remove unnecessary try-except statements

This patch affects two functions:

1. calc_points()
2. calc_win_loss()

Both functions use try-except statements to guard against type
coercion errors when converting function arguments to integers; and in
the event of an exception the program assigns a default. These guards
are unnecessary if we assign default values to the arguments
themselves, which is what this patch does. By giving the arguments
default values we can then replace the try-except statements with the
shorter Python idiom

foo = argumentValue if somethingTrue else defaultValue

This does not change the behavior of the program. It only eliminates
the superfluous use of try-except statements whose intents were
primarily to assign default values, not to handle exceptions.

Signed-off-by: Eric James Michael Ritz