You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code has, in many places, many if/elif/elif/..., but they don't end with elses.
This is a sign of something fishy: at best, it confuses the reader that is left thinking: "why are the other cases not treated"; at worst, it leads legitimate bugs.
One quick'n'dirty, not-really-a-solution, measure is to give each such chains an else statement that simply logs things (using the logging infrastructure already in place) when things go wrong (so that we know that there are cases that we are not treating). This may be a measure for the short-term release of version 1.5.
Alternatively, in non-release versions, we can (and should) throw exceptions whenever something reaches such an else clause that we don't know yet how to treat, so that the problems become evident upon running the program and trying to get work done.
The text was updated successfully, but these errors were encountered:
Add logging after all if/elif chains to make it easier to catch coding
mistaks. Sometimes, doing nothing is the expected, so a simple comment
and a `pass` statement were added for these cases.
The code has, in many places, many
if
/elif
/elif
/...
, but they don't end withelse
s.This is a sign of something fishy: at best, it confuses the reader that is left thinking: "why are the other cases not treated"; at worst, it leads legitimate bugs.
One quick'n'dirty, not-really-a-solution, measure is to give each such chains an
else
statement that simply logs things (using thelogging
infrastructure already in place) when things go wrong (so that we know that there are cases that we are not treating). This may be a measure for the short-term release of version 1.5.Alternatively, in non-release versions, we can (and should) throw exceptions whenever something reaches such an
else
clause that we don't know yet how to treat, so that the problems become evident upon running the program and trying to get work done.The text was updated successfully, but these errors were encountered: