Next / Previous / Contents / Shipman's homepage

23.2. Type defects

Because Python checks types only at runtime, these errors would have been caught earlier in a language that does compile-time type checking.

  1. 2012-01-19: In Section 12, “Truths.check(): Generate error messages”, this line:

            for inputList in self._permuter(len(self.__condList)):
    

    should have been:

            for inputList in self._permuter(len(self._condList)):
    

    Until recently, I used two underbars for internal methods. Now I use a single underbar. This error was pasted from an earlier, non-literate version of this program.

  2. 2012-01-19: In Section 10, “Truths.__init__(), used two different names for the induction variable in this loop:

            for linex in range(1, len(self._condList)):
                lenK = len(self._condList[k])
                ...
    

    The fix is to replace the second line above with:

                lenK = len(self._condList[linex])
    
  3. 2012-01-19: In Section 19, “Truths._overcovered(): Message for an over-covered input set”, in these lines:

            caseDisplay = ' '.join([self._oneCase[casex]
                                    for casex in matchList])
    

    the first line should read:

            caseDisplay = ' '.join([self._oneCase(casex)
                                    for casex in matchList])