C
Charles Hixson
This doesn't cause a crash, but rather incorrect results.
self.wordList = ["The", "quick", "brown", "fox", "carefully",
"jumps", "over", "the", "lazy", "dog", "as", "it",
"stealthily", "wends", "its", "way", "homewards", '\b.']
for i in range (len (self.wordList) ):
if not isinstance(self.wordList, str):
self.wordList = ""
elif self.wordList != "" and self.wordList[0] == "\b":
print ("0: wordList[", i, "] = \"", self.wordList, "\"", sep
= "")
print ("0a: wordList[", i, "][1] = \"", self.wordList[1],
"\"", sep = "")
tmp = self.wordList[1] ## !! Kludge --
remove tmp to see the error
self.wordList = tmp + self.wordList[1:-1] ## !!
Kludge -- remove tmp + to see the error
print ("1: wordList[", i, "] = \"", self.wordList, "\"", sep
= "")
print ("len(wordList[", i, "]) = ", len(self.wordList) )
self.wordList = ["The", "quick", "brown", "fox", "carefully",
"jumps", "over", "the", "lazy", "dog", "as", "it",
"stealthily", "wends", "its", "way", "homewards", '\b.']
for i in range (len (self.wordList) ):
if not isinstance(self.wordList, str):
self.wordList = ""
elif self.wordList != "" and self.wordList[0] == "\b":
print ("0: wordList[", i, "] = \"", self.wordList, "\"", sep
= "")
print ("0a: wordList[", i, "][1] = \"", self.wordList[1],
"\"", sep = "")
tmp = self.wordList[1] ## !! Kludge --
remove tmp to see the error
self.wordList = tmp + self.wordList[1:-1] ## !!
Kludge -- remove tmp + to see the error
print ("1: wordList[", i, "] = \"", self.wordList, "\"", sep
= "")
print ("len(wordList[", i, "]) = ", len(self.wordList) )