Changes between Initial Version and Version 1 of Ticket #1643, comment 4


Ignore:
Timestamp:
2011-12-18T19:25:12Z (13 years ago)
Author:
davidsarah
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1643, comment 4

    initial v1  
    1 For future reference, this should not have been an {{{assert}}}. Asserts should be used only for consistency checks that would indicate a bug if they ever fail, not for validating input. That is, if an assert can actually happen as a result of bad input, then it was the wrong way of expressing that constraint (because the resulting error reporting is usually ugly and provides insufficient information, and because asserts are [http://docs.python.org/reference/simple_stmts.html#the-assert-statement sometimes switched off]).
     1For future reference, this should not have been an {{{assert}}}. Assert statements should be used only for consistency checks that would indicate a bug if they ever fail, not for validating input. That is, if an assertion failure can actually happen as a result of bad input, then an assert was the wrong way of expressing that constraint (because the resulting error reporting is usually ugly and provides insufficient information, and because asserts are [http://docs.python.org/reference/simple_stmts.html#the-assert-statement sometimes switched off]).
     2
     3(Also note that even for consistency checks, we prefer the functions in [source:src/allmydata/util/assertutil.py].)