diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2001-01-02 16:30:31 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2001-01-02 16:30:31 (GMT) |
commit | fd288c7cd59cffcdb110d04dca1ba2e821aabac7 (patch) | |
tree | bd3453fa24800393d252b69ecf37233208ea5538 | |
parent | 10e31cf82e5fa325e779013619d9e11bf8b56c28 (diff) | |
download | cpython-fd288c7cd59cffcdb110d04dca1ba2e821aabac7.zip cpython-fd288c7cd59cffcdb110d04dca1ba2e821aabac7.tar.gz cpython-fd288c7cd59cffcdb110d04dca1ba2e821aabac7.tar.bz2 |
Add more tests for compare and coercion in preparation for the coercion
overhaul. Closes SF patch #102878.
-rw-r--r-- | Lib/test/output/test_coercion | 1054 | ||||
-rw-r--r-- | Lib/test/output/test_compare | 122 | ||||
-rw-r--r-- | Lib/test/test_coercion.py | 113 | ||||
-rw-r--r-- | Lib/test/test_compare.py | 57 |
4 files changed, 1346 insertions, 0 deletions
diff --git a/Lib/test/output/test_coercion b/Lib/test/output/test_coercion new file mode 100644 index 0000000..902adbd --- /dev/null +++ b/Lib/test/output/test_coercion @@ -0,0 +1,1054 @@ +test_coercion +2 + 2 = 4 +2 += 2 => 4 +2 - 2 = 0 +2 -= 2 => 0 +2 * 2 = 4 +2 *= 2 => 4 +2 / 2 = 1 +2 /= 2 => 1 +2 ** 2 = 4 +2 **= 2 => 4 +2 % 2 = 0 +2 %= 2 => 0 +2 + 2.2 = 4.2 +2 += 2.2 => 4.2 +2 - 2.2 = -0.2 +2 -= 2.2 => -0.2 +2 * 2.2 = 4.4 +2 *= 2.2 => 4.4 +2 / 2.2 = 0.909090909091 +2 /= 2.2 => 0.909090909091 +2 ** 2.2 = 4.59479341999 +2 **= 2.2 => 4.59479341999 +2 % 2.2 = 2.0 +2 %= 2.2 => 2.0 +2 + 2 = 4 +2 += 2 => 4 +2 - 2 = 0 +2 -= 2 => 0 +2 * 2 = 4 +2 *= 2 => 4 +2 / 2 = 1 +2 /= 2 => 1 +2 ** 2 = 4 +2 **= 2 => 4 +2 % 2 = 0 +2 %= 2 => 0 +2 + (2+4j) = (4+4j) +2 += (2+4j) => (4+4j) +2 - (2+4j) = -4j +2 -= (2+4j) => -4j +2 * (2+4j) = (4+8j) +2 *= (2+4j) => (4+8j) +2 / (2+4j) = (0.2-0.4j) +2 /= (2+4j) => (0.2-0.4j) +2 ** (2+4j) = (-3.73074830734+1.44274636276j) +2 **= (2+4j) => (-3.73074830734+1.44274636276j) +2 % (2+4j) = (2+0j) +2 %= (2+4j) => (2+0j) +2 + [1] ... exceptions.TypeError +2 += [1] ... exceptions.TypeError +2 - [1] ... exceptions.TypeError +2 -= [1] ... exceptions.TypeError +2 * [1] = [1, 1] +2 *= [1] ... exceptions.TypeError +2 / [1] ... exceptions.TypeError +2 /= [1] ... exceptions.TypeError +2 ** [1] ... exceptions.TypeError +2 **= [1] ... exceptions.TypeError +2 % [1] ... exceptions.TypeError +2 %= [1] ... exceptions.TypeError +2 + (2,) ... exceptions.TypeError +2 += (2,) ... exceptions.TypeError +2 - (2,) ... exceptions.TypeError +2 -= (2,) ... exceptions.TypeError +2 * (2,) = (2, 2) +2 *= (2,) ... exceptions.TypeError +2 / (2,) ... exceptions.TypeError +2 /= (2,) ... exceptions.TypeError +2 ** (2,) ... exceptions.TypeError +2 **= (2,) ... exceptions.TypeError +2 % (2,) ... exceptions.TypeError +2 %= (2,) ... exceptions.TypeError +2 + None ... exceptions.TypeError +2 += None ... exceptions.TypeError +2 - None ... exceptions.TypeError +2 -= None ... exceptions.TypeError +2 * None ... exceptions.TypeError +2 *= None ... exceptions.TypeError +2 / None ... exceptions.TypeError +2 /= None ... exceptions.TypeError +2 ** None ... exceptions.TypeError +2 **= None ... exceptions.TypeError +2 % None ... exceptions.TypeError +2 %= None ... exceptions.TypeError +2 + <MethodNumber 1> = 3 +2 += <MethodNumber 1> => 3 +2 - <MethodNumber 1> = 1 +2 -= <MethodNumber 1> => 1 +2 * <MethodNumber 1> = 2 +2 *= <MethodNumber 1> => 2 +2 / <MethodNumber 1> = 2 +2 /= <MethodNumber 1> => 2 +2 ** <MethodNumber 1> = 2 +2 **= <MethodNumber 1> => 2 +2 % <MethodNumber 1> = 0 +2 %= <MethodNumber 1> => 0 +2 + <CoerceNumber 8> = 10 +2 += <CoerceNumber 8> => 10 +2 - <CoerceNumber 8> = -6 +2 -= <CoerceNumber 8> => -6 +2 * <CoerceNumber 8> = 16 +2 *= <CoerceNumber 8> => 16 +2 / <CoerceNumber 8> = 0 +2 /= <CoerceNumber 8> => 0 +2 ** <CoerceNumber 8> = 256 +2 **= <CoerceNumber 8> => 256 +2 % <CoerceNumber 8> = 2 +2 %= <CoerceNumber 8> => 2 +2.2 + 2 = 4.2 +2.2 += 2 => 4.2 +2.2 - 2 = 0.2 +2.2 -= 2 => 0.2 +2.2 * 2 = 4.4 +2.2 *= 2 => 4.4 +2.2 / 2 = 1.1 +2.2 /= 2 => 1.1 +2.2 ** 2 = 4.84 +2.2 **= 2 => 4.84 +2.2 % 2 = 0.2 +2.2 %= 2 => 0.2 +2.2 + 2.2 = 4.4 +2.2 += 2.2 => 4.4 +2.2 - 2.2 = 0.0 +2.2 -= 2.2 => 0.0 +2.2 * 2.2 = 4.84 +2.2 *= 2.2 => 4.84 +2.2 / 2.2 = 1.0 +2.2 /= 2.2 => 1.0 +2.2 ** 2.2 = 5.66669577875 +2.2 **= 2.2 => 5.66669577875 +2.2 % 2.2 = 0.0 +2.2 %= 2.2 => 0.0 +2.2 + 2 = 4.2 +2.2 += 2 => 4.2 +2.2 - 2 = 0.2 +2.2 -= 2 => 0.2 +2.2 * 2 = 4.4 +2.2 *= 2 => 4.4 +2.2 / 2 = 1.1 +2.2 /= 2 => 1.1 +2.2 ** 2 = 4.84 +2.2 **= 2 => 4.84 +2.2 % 2 = 0.2 +2.2 %= 2 => 0.2 +2.2 + (2+4j) = (4.2+4j) +2.2 += (2+4j) => (4.2+4j) +2.2 - (2+4j) = (0.2-4j) +2.2 -= (2+4j) => (0.2-4j) +2.2 * (2+4j) = (4.4+8.8j) +2.2 *= (2+4j) => (4.4+8.8j) +2.2 / (2+4j) = (0.22-0.44j) +2.2 /= (2+4j) => (0.22-0.44j) +2.2 ** (2+4j) = (-4.8396376362-0.059224575214j) +2.2 **= (2+4j) => (-4.8396376362-0.059224575214j) +2.2 % (2+4j) = (2.2+0j) +2.2 %= (2+4j) => (2.2+0j) +2.2 + [1] ... exceptions.TypeError +2.2 += [1] ... exceptions.TypeError +2.2 - [1] ... exceptions.TypeError +2.2 -= [1] ... exceptions.TypeError +2.2 * [1] ... exceptions.TypeError +2.2 *= [1] ... exceptions.TypeError +2.2 / [1] ... exceptions.TypeError +2.2 /= [1] ... exceptions.TypeError +2.2 ** [1] ... exceptions.TypeError +2.2 **= [1] ... exceptions.TypeError +2.2 % [1] ... exceptions.TypeError +2.2 %= [1] ... exceptions.TypeError +2.2 + (2,) ... exceptions.TypeError +2.2 += (2,) ... exceptions.TypeError +2.2 - (2,) ... exceptions.TypeError +2.2 -= (2,) ... exceptions.TypeError +2.2 * (2,) ... exceptions.TypeError +2.2 *= (2,) ... exceptions.TypeError +2.2 / (2,) ... exceptions.TypeError +2.2 /= (2,) ... exceptions.TypeError +2.2 ** (2,) ... exceptions.TypeError +2.2 **= (2,) ... exceptions.TypeError +2.2 % (2,) ... exceptions.TypeError +2.2 %= (2,) ... exceptions.TypeError +2.2 + None ... exceptions.TypeError +2.2 += None ... exceptions.TypeError +2.2 - None ... exceptions.TypeError +2.2 -= None ... exceptions.TypeError +2.2 * None ... exceptions.TypeError +2.2 *= None ... exceptions.TypeError +2.2 / None ... exceptions.TypeError +2.2 /= None ... exceptions.TypeError +2.2 ** None ... exceptions.TypeError +2.2 **= None ... exceptions.TypeError +2.2 % None ... exceptions.TypeError +2.2 %= None ... exceptions.TypeError +2.2 + <MethodNumber 1> = 3.2 +2.2 += <MethodNumber 1> => 3.2 +2.2 - <MethodNumber 1> = 1.2 +2.2 -= <MethodNumber 1> => 1.2 +2.2 * <MethodNumber 1> = 2.2 +2.2 *= <MethodNumber 1> => 2.2 +2.2 / <MethodNumber 1> = 2.2 +2.2 /= <MethodNumber 1> => 2.2 +2.2 ** <MethodNumber 1> = 2.2 +2.2 **= <MethodNumber 1> => 2.2 +2.2 % <MethodNumber 1> = 0.2 +2.2 %= <MethodNumber 1> => 0.2 +2.2 + <CoerceNumber 8> = 10.2 +2.2 += <CoerceNumber 8> => 10.2 +2.2 - <CoerceNumber 8> = -5.8 +2.2 -= <CoerceNumber 8> => -5.8 +2.2 * <CoerceNumber 8> = 17.6 +2.2 *= <CoerceNumber 8> => 17.6 +2.2 / <CoerceNumber 8> = 0.275 +2.2 /= <CoerceNumber 8> => 0.275 +2.2 ** <CoerceNumber 8> = 548.75873536 +2.2 **= <CoerceNumber 8> => 548.75873536 +2.2 % <CoerceNumber 8> = 2.2 +2.2 %= <CoerceNumber 8> => 2.2 +2 + 2 = 4 +2 += 2 => 4 +2 - 2 = 0 +2 -= 2 => 0 +2 * 2 = 4 +2 *= 2 => 4 +2 / 2 = 1 +2 /= 2 => 1 +2 ** 2 = 4 +2 **= 2 => 4 +2 % 2 = 0 +2 %= 2 => 0 +2 + 2.2 = 4.2 +2 += 2.2 => 4.2 +2 - 2.2 = -0.2 +2 -= 2.2 => -0.2 +2 * 2.2 = 4.4 +2 *= 2.2 => 4.4 +2 / 2.2 = 0.909090909091 +2 /= 2.2 => 0.909090909091 +2 ** 2.2 = 4.59479341999 +2 **= 2.2 => 4.59479341999 +2 % 2.2 = 2.0 +2 %= 2.2 => 2.0 +2 + 2 = 4 +2 += 2 => 4 +2 - 2 = 0 +2 -= 2 => 0 +2 * 2 = 4 +2 *= 2 => 4 +2 / 2 = 1 +2 /= 2 => 1 +2 ** 2 = 4 +2 **= 2 => 4 +2 % 2 = 0 +2 %= 2 => 0 +2 + (2+4j) = (4+4j) +2 += (2+4j) => (4+4j) +2 - (2+4j) = -4j +2 -= (2+4j) => -4j +2 * (2+4j) = (4+8j) +2 *= (2+4j) => (4+8j) +2 / (2+4j) = (0.2-0.4j) +2 /= (2+4j) => (0.2-0.4j) +2 ** (2+4j) = (-3.73074830734+1.44274636276j) +2 **= (2+4j) => (-3.73074830734+1.44274636276j) +2 % (2+4j) = (2+0j) +2 %= (2+4j) => (2+0j) +2 + [1] ... exceptions.TypeError +2 += [1] ... exceptions.TypeError +2 - [1] ... exceptions.TypeError +2 -= [1] ... exceptions.TypeError +2 * [1] = [1, 1] +2 *= [1] ... exceptions.TypeError +2 / [1] ... exceptions.TypeError +2 /= [1] ... exceptions.TypeError +2 ** [1] ... exceptions.TypeError +2 **= [1] ... exceptions.TypeError +2 % [1] ... exceptions.TypeError +2 %= [1] ... exceptions.TypeError +2 + (2,) ... exceptions.TypeError +2 += (2,) ... exceptions.TypeError +2 - (2,) ... exceptions.TypeError +2 -= (2,) ... exceptions.TypeError +2 * (2,) = (2, 2) +2 *= (2,) ... exceptions.TypeError +2 / (2,) ... exceptions.TypeError +2 /= (2,) ... exceptions.TypeError +2 ** (2,) ... exceptions.TypeError +2 **= (2,) ... exceptions.TypeError +2 % (2,) ... exceptions.TypeError +2 %= (2,) ... exceptions.TypeError +2 + None ... exceptions.TypeError +2 += None ... exceptions.TypeError +2 - None ... exceptions.TypeError +2 -= None ... exceptions.TypeError +2 * None ... exceptions.TypeError +2 *= None ... exceptions.TypeError +2 / None ... exceptions.TypeError +2 /= None ... exceptions.TypeError +2 ** None ... exceptions.TypeError +2 **= None ... exceptions.TypeError +2 % None ... exceptions.TypeError +2 %= None ... exceptions.TypeError +2 + <MethodNumber 1> = 3 +2 += <MethodNumber 1> => 3 +2 - <MethodNumber 1> = 1 +2 -= <MethodNumber 1> => 1 +2 * <MethodNumber 1> = 2 +2 *= <MethodNumber 1> => 2 +2 / <MethodNumber 1> = 2 +2 /= <MethodNumber 1> => 2 +2 ** <MethodNumber 1> = 2 +2 **= <MethodNumber 1> => 2 +2 % <MethodNumber 1> = 0 +2 %= <MethodNumber 1> => 0 +2 + <CoerceNumber 8> = 10 +2 += <CoerceNumber 8> => 10 +2 - <CoerceNumber 8> = -6 +2 -= <CoerceNumber 8> => -6 +2 * <CoerceNumber 8> = 16 +2 *= <CoerceNumber 8> => 16 +2 / <CoerceNumber 8> = 0 +2 /= <CoerceNumber 8> => 0 +2 ** <CoerceNumber 8> = 256 +2 **= <CoerceNumber 8> => 256 +2 % <CoerceNumber 8> = 2 +2 %= <CoerceNumber 8> => 2 +(2+4j) + 2 = (4+4j) +(2+4j) += 2 => (4+4j) +(2+4j) - 2 = 4j +(2+4j) -= 2 => 4j +(2+4j) * 2 = (4+8j) +(2+4j) *= 2 => (4+8j) +(2+4j) / 2 = (1+2j) +(2+4j) /= 2 => (1+2j) +(2+4j) ** 2 = (-12+16j) +(2+4j) **= 2 => (-12+16j) +(2+4j) % 2 = 4j +(2+4j) %= 2 => 4j +(2+4j) + 2.2 = (4.2+4j) +(2+4j) += 2.2 => (4.2+4j) +(2+4j) - 2.2 = (-0.2+4j) +(2+4j) -= 2.2 => (-0.2+4j) +(2+4j) * 2.2 = (4.4+8.8j) +(2+4j) *= 2.2 => (4.4+8.8j) +(2+4j) / 2.2 = (0.909090909091+1.81818181818j) +(2+4j) /= 2.2 => (0.909090909091+1.81818181818j) +(2+4j) ** 2.2 = (-20.5374452851+17.5053998061j) +(2+4j) **= 2.2 => (-20.5374452851+17.5053998061j) +(2+4j) % 2.2 = (2+4j) +(2+4j) %= 2.2 => (2+4j) +(2+4j) + 2 = (4+4j) +(2+4j) += 2 => (4+4j) +(2+4j) - 2 = 4j +(2+4j) -= 2 => 4j +(2+4j) * 2 = (4+8j) +(2+4j) *= 2 => (4+8j) +(2+4j) / 2 = (1+2j) +(2+4j) /= 2 => (1+2j) +(2+4j) ** 2 = (-12+16j) +(2+4j) **= 2 => (-12+16j) +(2+4j) % 2 = 4j +(2+4j) %= 2 => 4j +(2+4j) + (2+4j) = (4+8j) +(2+4j) += (2+4j) => (4+8j) +(2+4j) - (2+4j) = 0j +(2+4j) -= (2+4j) => 0j +(2+4j) * (2+4j) = (-12+16j) +(2+4j) *= (2+4j) => (-12+16j) +(2+4j) / (2+4j) = (1+0j) +(2+4j) /= (2+4j) => (1+0j) +(2+4j) ** (2+4j) = (-0.0822228891036+0.224011648635j) +(2+4j) **= (2+4j) => (-0.0822228891036+0.224011648635j) +(2+4j) % (2+4j) = 0j +(2+4j) %= (2+4j) => 0j +(2+4j) + [1] ... exceptions.TypeError +(2+4j) += [1] ... exceptions.TypeError +(2+4j) - [1] ... exceptions.TypeError +(2+4j) -= [1] ... exceptions.TypeError +(2+4j) * [1] ... exceptions.TypeError +(2+4j) *= [1] ... exceptions.TypeError +(2+4j) / [1] ... exceptions.TypeError +(2+4j) /= [1] ... exceptions.TypeError +(2+4j) ** [1] ... exceptions.TypeError +(2+4j) **= [1] ... exceptions.TypeError +(2+4j) % [1] ... exceptions.TypeError +(2+4j) %= [1] ... exceptions.TypeError +(2+4j) + (2,) ... exceptions.TypeError +(2+4j) += (2,) ... exceptions.TypeError +(2+4j) - (2,) ... exceptions.TypeError +(2+4j) -= (2,) ... exceptions.TypeError +(2+4j) * (2,) ... exceptions.TypeError +(2+4j) *= (2,) ... exceptions.TypeError +(2+4j) / (2,) ... exceptions.TypeError +(2+4j) /= (2,) ... exceptions.TypeError +(2+4j) ** (2,) ... exceptions.TypeError +(2+4j) **= (2,) ... exceptions.TypeError +(2+4j) % (2,) ... exceptions.TypeError +(2+4j) %= (2,) ... exceptions.TypeError +(2+4j) + None ... exceptions.TypeError +(2+4j) += None ... exceptions.TypeError +(2+4j) - None ... exceptions.TypeError +(2+4j) -= None ... exceptions.TypeError +(2+4j) * None ... exceptions.TypeError +(2+4j) *= None ... exceptions.TypeError +(2+4j) / None ... exceptions.TypeError +(2+4j) /= None ... exceptions.TypeError +(2+4j) ** None ... exceptions.TypeError +(2+4j) **= None ... exceptions.TypeError +(2+4j) % None ... exceptions.TypeError +(2+4j) %= None ... exceptions.TypeError +(2+4j) + <MethodNumber 1> = (3+4j) +(2+4j) += <MethodNumber 1> => (3+4j) +(2+4j) - <MethodNumber 1> = (1+4j) +(2+4j) -= <MethodNumber 1> => (1+4j) +(2+4j) * <MethodNumber 1> = (2+4j) +(2+4j) *= <MethodNumber 1> => (2+4j) +(2+4j) / <MethodNumber 1> = (2+4j) +(2+4j) /= <MethodNumber 1> => (2+4j) +(2+4j) ** <MethodNumber 1> = (2+4j) +(2+4j) **= <MethodNumber 1> => (2+4j) +(2+4j) % <MethodNumber 1> = 4j +(2+4j) %= <MethodNumber 1> => 4j +(2+4j) + <CoerceNumber 8> = (10+4j) +(2+4j) += <CoerceNumber 8> => (10+4j) +(2+4j) - <CoerceNumber 8> = (-6+4j) +(2+4j) -= <CoerceNumber 8> => (-6+4j) +(2+4j) * <CoerceNumber 8> = (16+32j) +(2+4j) *= <CoerceNumber 8> => (16+32j) +(2+4j) / <CoerceNumber 8> = (0.25+0.5j) +(2+4j) /= <CoerceNumber 8> => (0.25+0.5j) +(2+4j) ** <CoerceNumber 8> = (-134912+86016j) +(2+4j) **= <CoerceNumber 8> => (-134912+86016j) +(2+4j) % <CoerceNumber 8> = (2+4j) +(2+4j) %= <CoerceNumber 8> => (2+4j) +[1] + 2 ... exceptions.TypeError +[1] += 2 ... exceptions.TypeError +[1] - 2 ... exceptions.TypeError +[1] -= 2 ... exceptions.TypeError +[1] * 2 = [1, 1] +[1] *= 2 => [1, 1] +[1] / 2 ... exceptions.TypeError +[1] /= 2 ... exceptions.TypeError +[1] ** 2 ... exceptions.TypeError +[1] **= 2 ... exceptions.TypeError +[1] % 2 ... exceptions.TypeError +[1] %= 2 ... exceptions.TypeError +[1] + 2.2 ... exceptions.TypeError +[1] += 2.2 ... exceptions.TypeError +[1] - 2.2 ... exceptions.TypeError +[1] -= 2.2 ... exceptions.TypeError +[1] * 2.2 ... exceptions.TypeError +[1] *= 2.2 ... exceptions.TypeError +[1] / 2.2 ... exceptions.TypeError +[1] /= 2.2 ... exceptions.TypeError +[1] ** 2.2 ... exceptions.TypeError +[1] **= 2.2 ... exceptions.TypeError +[1] % 2.2 ... exceptions.TypeError +[1] %= 2.2 ... exceptions.TypeError +[1] + 2 ... exceptions.TypeError +[1] += 2 ... exceptions.TypeError +[1] - 2 ... exceptions.TypeError +[1] -= 2 ... exceptions.TypeError +[1] * 2 = [1, 1] +[1] *= 2 => [1, 1] +[1] / 2 ... exceptions.TypeError +[1] /= 2 ... exceptions.TypeError +[1] ** 2 ... exceptions.TypeError +[1] **= 2 ... exceptions.TypeError +[1] % 2 ... exceptions.TypeError +[1] %= 2 ... exceptions.TypeError +[1] + (2+4j) ... exceptions.TypeError +[1] += (2+4j) ... exceptions.TypeError +[1] - (2+4j) ... exceptions.TypeError +[1] -= (2+4j) ... exceptions.TypeError +[1] * (2+4j) ... exceptions.TypeError +[1] *= (2+4j) ... exceptions.TypeError +[1] / (2+4j) ... exceptions.TypeError +[1] /= (2+4j) ... exceptions.TypeError +[1] ** (2+4j) ... exceptions.TypeError +[1] **= (2+4j) ... exceptions.TypeError +[1] % (2+4j) ... exceptions.TypeError +[1] %= (2+4j) ... exceptions.TypeError +[1] + [1] = [1, 1] +[1] += [1] => [1, 1] +[1] - [1] ... exceptions.TypeError +[1] -= [1] ... exceptions.TypeError +[1] * [1] ... exceptions.TypeError +[1] *= [1] ... exceptions.TypeError +[1] / [1] ... exceptions.TypeError +[1] /= [1] ... exceptions.TypeError +[1] ** [1] ... exceptions.TypeError +[1] **= [1] ... exceptions.TypeError +[1] % [1] ... exceptions.TypeError +[1] %= [1] ... exceptions.TypeError +[1] + (2,) ... exceptions.TypeError +[1] += (2,) => [1, 2] +[1] - (2,) ... exceptions.TypeError +[1] -= (2,) ... exceptions.TypeError +[1] * (2,) ... exceptions.TypeError +[1] *= (2,) ... exceptions.TypeError +[1] / (2,) ... exceptions.TypeError +[1] /= (2,) ... exceptions.TypeError +[1] ** (2,) ... exceptions.TypeError +[1] **= (2,) ... exceptions.TypeError +[1] % (2,) ... exceptions.TypeError +[1] %= (2,) ... exceptions.TypeError +[1] + None ... exceptions.TypeError +[1] += None ... exceptions.TypeError +[1] - None ... exceptions.TypeError +[1] -= None ... exceptions.TypeError +[1] * None ... exceptions.TypeError +[1] *= None ... exceptions.TypeError +[1] / None ... exceptions.TypeError +[1] /= None ... exceptions.TypeError +[1] ** None ... exceptions.TypeError +[1] **= None ... exceptions.TypeError +[1] % None ... exceptions.TypeError +[1] %= None ... exceptions.TypeError +[1] + <MethodNumber 1> ... exceptions.TypeError +[1] += <MethodNumber 1> ... exceptions.AttributeError +[1] - <MethodNumber 1> ... exceptions.TypeError +[1] -= <MethodNumber 1> ... exceptions.TypeError +[1] * <MethodNumber 1> = [1] +[1] *= <MethodNumber 1> ... exceptions.TypeError +[1] / <MethodNumber 1> ... exceptions.TypeError +[1] /= <MethodNumber 1> ... exceptions.TypeError +[1] ** <MethodNumber 1> ... exceptions.TypeError +[1] **= <MethodNumber 1> ... exceptions.TypeError +[1] % <MethodNumber 1> ... exceptions.TypeError +[1] %= <MethodNumber 1> ... exceptions.TypeError +[1] + <CoerceNumber 8> ... exceptions.TypeError +[1] += <CoerceNumber 8> ... exceptions.AttributeError +[1] - <CoerceNumber 8> ... exceptions.TypeError +[1] -= <CoerceNumber 8> ... exceptions.TypeError +[1] * <CoerceNumber 8> = [1, 1, 1, 1, 1, 1, 1, 1] +[1] *= <CoerceNumber 8> ... exceptions.TypeError +[1] / <CoerceNumber 8> ... exceptions.TypeError +[1] /= <CoerceNumber 8> ... exceptions.TypeError +[1] ** <CoerceNumber 8> ... exceptions.TypeError +[1] **= <CoerceNumber 8> ... exceptions.TypeError +[1] % <CoerceNumber 8> ... exceptions.TypeError +[1] %= <CoerceNumber 8> ... exceptions.TypeError +(2,) + 2 ... exceptions.TypeError +(2,) += 2 ... exceptions.TypeError +(2,) - 2 ... exceptions.TypeError +(2,) -= 2 ... exceptions.TypeError +(2,) * 2 = (2, 2) +(2,) *= 2 => (2, 2) +(2,) / 2 ... exceptions.TypeError +(2,) /= 2 ... exceptions.TypeError +(2,) ** 2 ... exceptions.TypeError +(2,) **= 2 ... exceptions.TypeError +(2,) % 2 ... exceptions.TypeError +(2,) %= 2 ... exceptions.TypeError +(2,) + 2.2 ... exceptions.TypeError +(2,) += 2.2 ... exceptions.TypeError +(2,) - 2.2 ... exceptions.TypeError +(2,) -= 2.2 ... exceptions.TypeError +(2,) * 2.2 ... exceptions.TypeError +(2,) *= 2.2 ... exceptions.TypeError +(2,) / 2.2 ... exceptions.TypeError +(2,) /= 2.2 ... exceptions.TypeError +(2,) ** 2.2 ... exceptions.TypeError +(2,) **= 2.2 ... exceptions.TypeError +(2,) % 2.2 ... exceptions.TypeError +(2,) %= 2.2 ... exceptions.TypeError +(2,) + 2 ... exceptions.TypeError +(2,) += 2 ... exceptions.TypeError +(2,) - 2 ... exceptions.TypeError +(2,) -= 2 ... exceptions.TypeError +(2,) * 2 = (2, 2) +(2,) *= 2 => (2, 2) +(2,) / 2 ... exceptions.TypeError +(2,) /= 2 ... exceptions.TypeError +(2,) ** 2 ... exceptions.TypeError +(2,) **= 2 ... exceptions.TypeError +(2,) % 2 ... exceptions.TypeError +(2,) %= 2 ... exceptions.TypeError +(2,) + (2+4j) ... exceptions.TypeError +(2,) += (2+4j) ... exceptions.TypeError +(2,) - (2+4j) ... exceptions.TypeError +(2,) -= (2+4j) ... exceptions.TypeError +(2,) * (2+4j) ... exceptions.TypeError +(2,) *= (2+4j) ... exceptions.TypeError +(2,) / (2+4j) ... exceptions.TypeError +(2,) /= (2+4j) ... exceptions.TypeError +(2,) ** (2+4j) ... exceptions.TypeError +(2,) **= (2+4j) ... exceptions.TypeError +(2,) % (2+4j) ... exceptions.TypeError +(2,) %= (2+4j) ... exceptions.TypeError +(2,) + [1] ... exceptions.TypeError +(2,) += [1] ... exceptions.TypeError +(2,) - [1] ... exceptions.TypeError +(2,) -= [1] ... exceptions.TypeError +(2,) * [1] ... exceptions.TypeError +(2,) *= [1] ... exceptions.TypeError +(2,) / [1] ... exceptions.TypeError +(2,) /= [1] ... exceptions.TypeError +(2,) ** [1] ... exceptions.TypeError +(2,) **= [1] ... exceptions.TypeError +(2,) % [1] ... exceptions.TypeError +(2,) %= [1] ... exceptions.TypeError +(2,) + (2,) = (2, 2) +(2,) += (2,) => (2, 2) +(2,) - (2,) ... exceptions.TypeError +(2,) -= (2,) ... exceptions.TypeError +(2,) * (2,) ... exceptions.TypeError +(2,) *= (2,) ... exceptions.TypeError +(2,) / (2,) ... exceptions.TypeError +(2,) /= (2,) ... exceptions.TypeError +(2,) ** (2,) ... exceptions.TypeError +(2,) **= (2,) ... exceptions.TypeError +(2,) % (2,) ... exceptions.TypeError +(2,) %= (2,) ... exceptions.TypeError +(2,) + None ... exceptions.TypeError +(2,) += None ... exceptions.TypeError +(2,) - None ... exceptions.TypeError +(2,) -= None ... exceptions.TypeError +(2,) * None ... exceptions.TypeError +(2,) *= None ... exceptions.TypeError +(2,) / None ... exceptions.TypeError +(2,) /= None ... exceptions.TypeError +(2,) ** None ... exceptions.TypeError +(2,) **= None ... exceptions.TypeError +(2,) % None ... exceptions.TypeError +(2,) %= None ... exceptions.TypeError +(2,) + <MethodNumber 1> ... exceptions.TypeError +(2,) += <MethodNumber 1> ... exceptions.TypeError +(2,) - <MethodNumber 1> ... exceptions.TypeError +(2,) -= <MethodNumber 1> ... exceptions.TypeError +(2,) * <MethodNumber 1> = (2,) +(2,) *= <MethodNumber 1> => (2,) +(2,) / <MethodNumber 1> ... exceptions.TypeError +(2,) /= <MethodNumber 1> ... exceptions.TypeError +(2,) ** <MethodNumber 1> ... exceptions.TypeError +(2,) **= <MethodNumber 1> ... exceptions.TypeError +(2,) % <MethodNumber 1> ... exceptions.TypeError +(2,) %= <MethodNumber 1> ... exceptions.TypeError +(2,) + <CoerceNumber 8> ... exceptions.TypeError +(2,) += <CoerceNumber 8> ... exceptions.TypeError +(2,) - <CoerceNumber 8> ... exceptions.TypeError +(2,) -= <CoerceNumber 8> ... exceptions.TypeError +(2,) * <CoerceNumber 8> = (2, 2, 2, 2, 2, 2, 2, 2) +(2,) *= <CoerceNumber 8> => (2, 2, 2, 2, 2, 2, 2, 2) +(2,) / <CoerceNumber 8> ... exceptions.TypeError +(2,) /= <CoerceNumber 8> ... exceptions.TypeError +(2,) ** <CoerceNumber 8> ... exceptions.TypeError +(2,) **= <CoerceNumber 8> ... exceptions.TypeError +(2,) % <CoerceNumber 8> ... exceptions.TypeError +(2,) %= <CoerceNumber 8> ... exceptions.TypeError +None + 2 ... exceptions.TypeError +None += 2 ... exceptions.TypeError +None - 2 ... exceptions.TypeError +None -= 2 ... exceptions.TypeError +None * 2 ... exceptions.TypeError +None *= 2 ... exceptions.TypeError +None / 2 ... exceptions.TypeError +None /= 2 ... exceptions.TypeError +None ** 2 ... exceptions.TypeError +None **= 2 ... exceptions.TypeError +None % 2 ... exceptions.TypeError +None %= 2 ... exceptions.TypeError +None + 2.2 ... exceptions.TypeError +None += 2.2 ... exceptions.TypeError +None - 2.2 ... exceptions.TypeError +None -= 2.2 ... exceptions.TypeError +None * 2.2 ... exceptions.TypeError +None *= 2.2 ... exceptions.TypeError +None / 2.2 ... exceptions.TypeError +None /= 2.2 ... exceptions.TypeError +None ** 2.2 ... exceptions.TypeError +None **= 2.2 ... exceptions.TypeError +None % 2.2 ... exceptions.TypeError +None %= 2.2 ... exceptions.TypeError +None + 2 ... exceptions.TypeError +None += 2 ... exceptions.TypeError +None - 2 ... exceptions.TypeError +None -= 2 ... exceptions.TypeError +None * 2 ... exceptions.TypeError +None *= 2 ... exceptions.TypeError +None / 2 ... exceptions.TypeError +None /= 2 ... exceptions.TypeError +None ** 2 ... exceptions.TypeError +None **= 2 ... exceptions.TypeError +None % 2 ... exceptions.TypeError +None %= 2 ... exceptions.TypeError +None + (2+4j) ... exceptions.TypeError +None += (2+4j) ... exceptions.TypeError +None - (2+4j) ... exceptions.TypeError +None -= (2+4j) ... exceptions.TypeError +None * (2+4j) ... exceptions.TypeError +None *= (2+4j) ... exceptions.TypeError +None / (2+4j) ... exceptions.TypeError +None /= (2+4j) ... exceptions.TypeError +None ** (2+4j) ... exceptions.TypeError +None **= (2+4j) ... exceptions.TypeError +None % (2+4j) ... exceptions.TypeError +None %= (2+4j) ... exceptions.TypeError +None + [1] ... exceptions.TypeError +None += [1] ... exceptions.TypeError +None - [1] ... exceptions.TypeError +None -= [1] ... exceptions.TypeError +None * [1] ... exceptions.TypeError +None *= [1] ... exceptions.TypeError +None / [1] ... exceptions.TypeError +None /= [1] ... exceptions.TypeError +None ** [1] ... exceptions.TypeError +None **= [1] ... exceptions.TypeError +None % [1] ... exceptions.TypeError +None %= [1] ... exceptions.TypeError +None + (2,) ... exceptions.TypeError +None += (2,) ... exceptions.TypeError +None - (2,) ... exceptions.TypeError +None -= (2,) ... exceptions.TypeError +None * (2,) ... exceptions.TypeError +None *= (2,) ... exceptions.TypeError +None / (2,) ... exceptions.TypeError +None /= (2,) ... exceptions.TypeError +None ** (2,) ... exceptions.TypeError +None **= (2,) ... exceptions.TypeError +None % (2,) ... exceptions.TypeError +None %= (2,) ... exceptions.TypeError +None + None ... exceptions.TypeError +None += None ... exceptions.TypeError +None - None ... exceptions.TypeError +None -= None ... exceptions.TypeError +None * None ... exceptions.TypeError +None *= None ... exceptions.TypeError +None / None ... exceptions.TypeError +None /= None ... exceptions.TypeError +None ** None ... exceptions.TypeError +None **= None ... exceptions.TypeError +None % None ... exceptions.TypeError +None %= None ... exceptions.TypeError +None + <MethodNumber 1> ... exceptions.TypeError +None += <MethodNumber 1> ... exceptions.TypeError +None - <MethodNumber 1> ... exceptions.TypeError +None -= <MethodNumber 1> ... exceptions.TypeError +None * <MethodNumber 1> ... exceptions.TypeError +None *= <MethodNumber 1> ... exceptions.TypeError +None / <MethodNumber 1> ... exceptions.TypeError +None /= <MethodNumber 1> ... exceptions.TypeError +None ** <MethodNumber 1> ... exceptions.TypeError +None **= <MethodNumber 1> ... exceptions.TypeError +None % <MethodNumber 1> ... exceptions.TypeError +None %= <MethodNumber 1> ... exceptions.TypeError +None + <CoerceNumber 8> ... exceptions.TypeError +None += <CoerceNumber 8> ... exceptions.TypeError +None - <CoerceNumber 8> ... exceptions.TypeError +None -= <CoerceNumber 8> ... exceptions.TypeError +None * <CoerceNumber 8> ... exceptions.TypeError +None *= <CoerceNumber 8> ... exceptions.TypeError +None / <CoerceNumber 8> ... exceptions.TypeError +None /= <CoerceNumber 8> ... exceptions.TypeError +None ** <CoerceNumber 8> ... exceptions.TypeError +None **= <CoerceNumber 8> ... exceptions.TypeError +None % <CoerceNumber 8> ... exceptions.TypeError +None %= <CoerceNumber 8> ... exceptions.TypeError +<MethodNumber 1> + 2 = 3 +<MethodNumber 1> += 2 => 3 +<MethodNumber 1> - 2 = -1 +<MethodNumber 1> -= 2 => -1 +<MethodNumber 1> * 2 = 2 +<MethodNumber 1> *= 2 => 2 +<MethodNumber 1> / 2 = 0 +<MethodNumber 1> /= 2 => 0 +<MethodNumber 1> ** 2 = 1 +<MethodNumber 1> **= 2 => 1 +<MethodNumber 1> % 2 = 1 +<MethodNumber 1> %= 2 => 1 +<MethodNumber 1> + 2.2 = 3.2 +<MethodNumber 1> += 2.2 => 3.2 +<MethodNumber 1> - 2.2 = -1.2 +<MethodNumber 1> -= 2.2 => -1.2 +<MethodNumber 1> * 2.2 = 2.2 +<MethodNumber 1> *= 2.2 => 2.2 +<MethodNumber 1> / 2.2 = 0.454545454545 +<MethodNumber 1> /= 2.2 => 0.454545454545 +<MethodNumber 1> ** 2.2 = 1.0 +<MethodNumber 1> **= 2.2 => 1.0 +<MethodNumber 1> % 2.2 = 1.0 +<MethodNumber 1> %= 2.2 => 1.0 +<MethodNumber 1> + 2 = 3 +<MethodNumber 1> += 2 => 3 +<MethodNumber 1> - 2 = -1 +<MethodNumber 1> -= 2 => -1 +<MethodNumber 1> * 2 = 2 +<MethodNumber 1> *= 2 => 2 +<MethodNumber 1> / 2 = 0 +<MethodNumber 1> /= 2 => 0 +<MethodNumber 1> ** 2 = 1 +<MethodNumber 1> **= 2 => 1 +<MethodNumber 1> % 2 = 1 +<MethodNumber 1> %= 2 => 1 +<MethodNumber 1> + (2+4j) = (3+4j) +<MethodNumber 1> += (2+4j) => (3+4j) +<MethodNumber 1> - (2+4j) = (-1-4j) +<MethodNumber 1> -= (2+4j) => (-1-4j) +<MethodNumber 1> * (2+4j) = (2+4j) +<MethodNumber 1> *= (2+4j) => (2+4j) +<MethodNumber 1> / (2+4j) = (0.1-0.2j) +<MethodNumber 1> /= (2+4j) => (0.1-0.2j) +<MethodNumber 1> ** (2+4j) = (1+0j) +<MethodNumber 1> **= (2+4j) => (1+0j) +<MethodNumber 1> % (2+4j) = (1+0j) +<MethodNumber 1> %= (2+4j) => (1+0j) +<MethodNumber 1> + [1] ... exceptions.TypeError +<MethodNumber 1> += [1] ... exceptions.TypeError +<MethodNumber 1> - [1] ... exceptions.TypeError +<MethodNumber 1> -= [1] ... exceptions.TypeError +<MethodNumber 1> * [1] = [1] +<MethodNumber 1> *= [1] => [1] +<MethodNumber 1> / [1] ... exceptions.TypeError +<MethodNumber 1> /= [1] ... exceptions.TypeError +<MethodNumber 1> ** [1] ... exceptions.TypeError +<MethodNumber 1> **= [1] ... exceptions.TypeError +<MethodNumber 1> % [1] ... exceptions.TypeError +<MethodNumber 1> %= [1] ... exceptions.TypeError +<MethodNumber 1> + (2,) ... exceptions.TypeError +<MethodNumber 1> += (2,) ... exceptions.TypeError +<MethodNumber 1> - (2,) ... exceptions.TypeError +<MethodNumber 1> -= (2,) ... exceptions.TypeError +<MethodNumber 1> * (2,) = (2,) +<MethodNumber 1> *= (2,) => (2,) +<MethodNumber 1> / (2,) ... exceptions.TypeError +<MethodNumber 1> /= (2,) ... exceptions.TypeError +<MethodNumber 1> ** (2,) ... exceptions.TypeError +<MethodNumber 1> **= (2,) ... exceptions.TypeError +<MethodNumber 1> % (2,) ... exceptions.TypeError +<MethodNumber 1> %= (2,) ... exceptions.TypeError +<MethodNumber 1> + None ... exceptions.TypeError +<MethodNumber 1> += None ... exceptions.TypeError +<MethodNumber 1> - None ... exceptions.TypeError +<MethodNumber 1> -= None ... exceptions.TypeError +<MethodNumber 1> * None ... exceptions.TypeError +<MethodNumber 1> *= None ... exceptions.TypeError +<MethodNumber 1> / None ... exceptions.TypeError +<MethodNumber 1> /= None ... exceptions.TypeError +<MethodNumber 1> ** None ... exceptions.TypeError +<MethodNumber 1> **= None ... exceptions.TypeError +<MethodNumber 1> % None ... exceptions.TypeError +<MethodNumber 1> %= None ... exceptions.TypeError +<MethodNumber 1> + <MethodNumber 1> = 2 +<MethodNumber 1> += <MethodNumber 1> => 2 +<MethodNumber 1> - <MethodNumber 1> = 0 +<MethodNumber 1> -= <MethodNumber 1> => 0 +<MethodNumber 1> * <MethodNumber 1> = 1 +<MethodNumber 1> *= <MethodNumber 1> => 1 +<MethodNumber 1> / <MethodNumber 1> = 1 +<MethodNumber 1> /= <MethodNumber 1> => 1 +<MethodNumber 1> ** <MethodNumber 1> = 1 +<MethodNumber 1> **= <MethodNumber 1> => 1 +<MethodNumber 1> % <MethodNumber 1> = 0 +<MethodNumber 1> %= <MethodNumber 1> => 0 +<MethodNumber 1> + <CoerceNumber 8> = 9 +<MethodNumber 1> += <CoerceNumber 8> => 9 +<MethodNumber 1> - <CoerceNumber 8> = -7 +<MethodNumber 1> -= <CoerceNumber 8> => -7 +<MethodNumber 1> * <CoerceNumber 8> = 8 +<MethodNumber 1> *= <CoerceNumber 8> => 8 +<MethodNumber 1> / <CoerceNumber 8> = 0 +<MethodNumber 1> /= <CoerceNumber 8> => 0 +<MethodNumber 1> ** <CoerceNumber 8> = 1 +<MethodNumber 1> **= <CoerceNumber 8> => 1 +<MethodNumber 1> % <CoerceNumber 8> = 1 +<MethodNumber 1> %= <CoerceNumber 8> => 1 +<CoerceNumber 8> + 2 = 10 +<CoerceNumber 8> += 2 => 10 +<CoerceNumber 8> - 2 = 6 +<CoerceNumber 8> -= 2 => 6 +<CoerceNumber 8> * 2 = 16 +<CoerceNumber 8> *= 2 => 16 +<CoerceNumber 8> / 2 = 4 +<CoerceNumber 8> /= 2 => 4 +<CoerceNumber 8> ** 2 = 64 +<CoerceNumber 8> **= 2 => 64 +<CoerceNumber 8> % 2 = 0 +<CoerceNumber 8> %= 2 => 0 +<CoerceNumber 8> + 2.2 = 10.2 +<CoerceNumber 8> += 2.2 => 10.2 +<CoerceNumber 8> - 2.2 = 5.8 +<CoerceNumber 8> -= 2.2 => 5.8 +<CoerceNumber 8> * 2.2 = 17.6 +<CoerceNumber 8> *= 2.2 => 17.6 +<CoerceNumber 8> / 2.2 = 3.63636363636 +<CoerceNumber 8> /= 2.2 => 3.63636363636 +<CoerceNumber 8> ** 2.2 = 97.0058602567 +<CoerceNumber 8> **= 2.2 => 97.0058602567 +<CoerceNumber 8> % 2.2 = 1.4 +<CoerceNumber 8> %= 2.2 => 1.4 +<CoerceNumber 8> + 2 = 10 +<CoerceNumber 8> += 2 => 10 +<CoerceNumber 8> - 2 = 6 +<CoerceNumber 8> -= 2 => 6 +<CoerceNumber 8> * 2 = 16 +<CoerceNumber 8> *= 2 => 16 +<CoerceNumber 8> / 2 = 4 +<CoerceNumber 8> /= 2 => 4 +<CoerceNumber 8> ** 2 = 64 +<CoerceNumber 8> **= 2 => 64 +<CoerceNumber 8> % 2 = 0 +<CoerceNumber 8> %= 2 => 0 +<CoerceNumber 8> + (2+4j) = (10+4j) +<CoerceNumber 8> += (2+4j) => (10+4j) +<CoerceNumber 8> - (2+4j) = (6-4j) +<CoerceNumber 8> -= (2+4j) => (6-4j) +<CoerceNumber 8> * (2+4j) = (16+32j) +<CoerceNumber 8> *= (2+4j) => (16+32j) +<CoerceNumber 8> / (2+4j) = (0.8-1.6j) +<CoerceNumber 8> /= (2+4j) => (0.8-1.6j) +<CoerceNumber 8> ** (2+4j) = (-28.6295078161+57.2394207012j) +<CoerceNumber 8> **= (2+4j) => (-28.6295078161+57.2394207012j) +<CoerceNumber 8> % (2+4j) = (8+0j) +<CoerceNumber 8> %= (2+4j) => (8+0j) +<CoerceNumber 8> + [1] ... exceptions.TypeError +<CoerceNumber 8> += [1] ... exceptions.TypeError +<CoerceNumber 8> - [1] ... exceptions.TypeError +<CoerceNumber 8> -= [1] ... exceptions.TypeError +<CoerceNumber 8> * [1] = [1, 1, 1, 1, 1, 1, 1, 1] +<CoerceNumber 8> *= [1] => [1, 1, 1, 1, 1, 1, 1, 1] +<CoerceNumber 8> / [1] ... exceptions.TypeError +<CoerceNumber 8> /= [1] ... exceptions.TypeError +<CoerceNumber 8> ** [1] ... exceptions.TypeError +<CoerceNumber 8> **= [1] ... exceptions.TypeError +<CoerceNumber 8> % [1] ... exceptions.TypeError +<CoerceNumber 8> %= [1] ... exceptions.TypeError +<CoerceNumber 8> + (2,) ... exceptions.TypeError +<CoerceNumber 8> += (2,) ... exceptions.TypeError +<CoerceNumber 8> - (2,) ... exceptions.TypeError +<CoerceNumber 8> -= (2,) ... exceptions.TypeError +<CoerceNumber 8> * (2,) = (2, 2, 2, 2, 2, 2, 2, 2) +<CoerceNumber 8> *= (2,) => (2, 2, 2, 2, 2, 2, 2, 2) +<CoerceNumber 8> / (2,) ... exceptions.TypeError +<CoerceNumber 8> /= (2,) ... exceptions.TypeError +<CoerceNumber 8> ** (2,) ... exceptions.TypeError +<CoerceNumber 8> **= (2,) ... exceptions.TypeError +<CoerceNumber 8> % (2,) ... exceptions.TypeError +<CoerceNumber 8> %= (2,) ... exceptions.TypeError +<CoerceNumber 8> + None ... exceptions.TypeError +<CoerceNumber 8> += None ... exceptions.TypeError +<CoerceNumber 8> - None ... exceptions.TypeError +<CoerceNumber 8> -= None ... exceptions.TypeError +<CoerceNumber 8> * None ... exceptions.TypeError +<CoerceNumber 8> *= None ... exceptions.TypeError +<CoerceNumber 8> / None ... exceptions.TypeError +<CoerceNumber 8> /= None ... exceptions.TypeError +<CoerceNumber 8> ** None ... exceptions.TypeError +<CoerceNumber 8> **= None ... exceptions.TypeError +<CoerceNumber 8> % None ... exceptions.TypeError +<CoerceNumber 8> %= None ... exceptions.TypeError +<CoerceNumber 8> + <MethodNumber 1> = 9 +<CoerceNumber 8> += <MethodNumber 1> => 9 +<CoerceNumber 8> - <MethodNumber 1> = 7 +<CoerceNumber 8> -= <MethodNumber 1> => 7 +<CoerceNumber 8> * <MethodNumber 1> = 8 +<CoerceNumber 8> *= <MethodNumber 1> => 8 +<CoerceNumber 8> / <MethodNumber 1> = 8 +<CoerceNumber 8> /= <MethodNumber 1> => 8 +<CoerceNumber 8> ** <MethodNumber 1> = 8 +<CoerceNumber 8> **= <MethodNumber 1> => 8 +<CoerceNumber 8> % <MethodNumber 1> = 0 +<CoerceNumber 8> %= <MethodNumber 1> => 0 +<CoerceNumber 8> + <CoerceNumber 8> = 16 +<CoerceNumber 8> += <CoerceNumber 8> => 16 +<CoerceNumber 8> - <CoerceNumber 8> = 0 +<CoerceNumber 8> -= <CoerceNumber 8> => 0 +<CoerceNumber 8> * <CoerceNumber 8> = 64 +<CoerceNumber 8> *= <CoerceNumber 8> => 64 +<CoerceNumber 8> / <CoerceNumber 8> = 1 +<CoerceNumber 8> /= <CoerceNumber 8> => 1 +<CoerceNumber 8> ** <CoerceNumber 8> = 16777216 +<CoerceNumber 8> **= <CoerceNumber 8> => 16777216 +<CoerceNumber 8> % <CoerceNumber 8> = 0 +<CoerceNumber 8> %= <CoerceNumber 8> => 0 +divmod(2, 2) = (1, 0) +divmod(2, 2.2) = (0.0, 2.0) +divmod(2, 2) = (1L, 0L) +divmod(2, (2+4j)) = (0j, (2+0j)) +divmod(2, [1]) ... exceptions.TypeError +divmod(2, (2,)) ... exceptions.TypeError +divmod(2, None) ... exceptions.TypeError +divmod(2, <MethodNumber 1>) ... exceptions.TypeError +divmod(2, <CoerceNumber 8>) = (0, 2) +divmod(2.2, 2) = (1.0, 0.20000000000000018) +divmod(2.2, 2.2) = (1.0, 0.0) +divmod(2.2, 2) = (1.0, 0.20000000000000018) +divmod(2.2, (2+4j)) = (0j, (2.2+0j)) +divmod(2.2, [1]) ... exceptions.TypeError +divmod(2.2, (2,)) ... exceptions.TypeError +divmod(2.2, None) ... exceptions.TypeError +divmod(2.2, <MethodNumber 1>) ... exceptions.TypeError +divmod(2.2, <CoerceNumber 8>) = (0.0, 2.2000000000000002) +divmod(2, 2) = (1L, 0L) +divmod(2, 2.2) = (0.0, 2.0) +divmod(2, 2) = (1L, 0L) +divmod(2, (2+4j)) = (0j, (2+0j)) +divmod(2, [1]) ... exceptions.TypeError +divmod(2, (2,)) ... exceptions.TypeError +divmod(2, None) ... exceptions.TypeError +divmod(2, <MethodNumber 1>) ... exceptions.TypeError +divmod(2, <CoerceNumber 8>) = (0L, 2L) +divmod((2+4j), 2) = ((1+0j), 4j) +divmod((2+4j), 2.2) = (0j, (2+4j)) +divmod((2+4j), 2) = ((1+0j), 4j) +divmod((2+4j), (2+4j)) = ((1+0j), 0j) +divmod((2+4j), [1]) ... exceptions.TypeError +divmod((2+4j), (2,)) ... exceptions.TypeError +divmod((2+4j), None) ... exceptions.TypeError +divmod((2+4j), <MethodNumber 1>) ... exceptions.TypeError +divmod((2+4j), <CoerceNumber 8>) = (0j, (2+4j)) +divmod([1], 2) ... exceptions.TypeError +divmod([1], 2.2) ... exceptions.TypeError +divmod([1], 2) ... exceptions.TypeError +divmod([1], (2+4j)) ... exceptions.TypeError +divmod([1], [1]) ... exceptions.TypeError +divmod([1], (2,)) ... exceptions.TypeError +divmod([1], None) ... exceptions.TypeError +divmod([1], <MethodNumber 1>) ... exceptions.TypeError +divmod([1], <CoerceNumber 8>) ... exceptions.TypeError +divmod((2,), 2) ... exceptions.TypeError +divmod((2,), 2.2) ... exceptions.TypeError +divmod((2,), 2) ... exceptions.TypeError +divmod((2,), (2+4j)) ... exceptions.TypeError +divmod((2,), [1]) ... exceptions.TypeError +divmod((2,), (2,)) ... exceptions.TypeError +divmod((2,), None) ... exceptions.TypeError +divmod((2,), <MethodNumber 1>) ... exceptions.TypeError +divmod((2,), <CoerceNumber 8>) ... exceptions.TypeError +divmod(None, 2) ... exceptions.TypeError +divmod(None, 2.2) ... exceptions.TypeError +divmod(None, 2) ... exceptions.TypeError +divmod(None, (2+4j)) ... exceptions.TypeError +divmod(None, [1]) ... exceptions.TypeError +divmod(None, (2,)) ... exceptions.TypeError +divmod(None, None) ... exceptions.TypeError +divmod(None, <MethodNumber 1>) ... exceptions.TypeError +divmod(None, <CoerceNumber 8>) ... exceptions.TypeError +divmod(<MethodNumber 1>, 2) ... exceptions.TypeError +divmod(<MethodNumber 1>, 2.2) ... exceptions.TypeError +divmod(<MethodNumber 1>, 2) ... exceptions.TypeError +divmod(<MethodNumber 1>, (2+4j)) ... exceptions.TypeError +divmod(<MethodNumber 1>, [1]) ... exceptions.TypeError +divmod(<MethodNumber 1>, (2,)) ... exceptions.TypeError +divmod(<MethodNumber 1>, None) ... exceptions.TypeError +divmod(<MethodNumber 1>, <MethodNumber 1>) ... exceptions.TypeError +divmod(<MethodNumber 1>, <CoerceNumber 8>) ... exceptions.TypeError +divmod(<CoerceNumber 8>, 2) = (4, 0) +divmod(<CoerceNumber 8>, 2.2) = (3.0, 1.3999999999999995) +divmod(<CoerceNumber 8>, 2) = (4L, 0L) +divmod(<CoerceNumber 8>, (2+4j)) = (0j, (8+0j)) +divmod(<CoerceNumber 8>, [1]) ... exceptions.TypeError +divmod(<CoerceNumber 8>, (2,)) ... exceptions.TypeError +divmod(<CoerceNumber 8>, None) ... exceptions.TypeError +divmod(<CoerceNumber 8>, <MethodNumber 1>) ... exceptions.TypeError +divmod(<CoerceNumber 8>, <CoerceNumber 8>) = (1, 0) diff --git a/Lib/test/output/test_compare b/Lib/test/output/test_compare new file mode 100644 index 0000000..4df9e49 --- /dev/null +++ b/Lib/test/output/test_compare @@ -0,0 +1,122 @@ +test_compare +cmp(2, 2) = 0 +cmp(2, 2.2) = -1 +cmp(2, 2) = 0 +cmp(2, (2+4j)) = -1 +cmp(2, [1]) = -108 +cmp(2, (2,)) = -116 +cmp(2, None) = -78 +cmp(2, <Empty>) = -1 +cmp(2, <Coerce 3>) = -1 +cmp(2, <Cmp 4>) = -1 +cmp(2, <RCmp 5>) = -1 +cmp(2.2, 2) = 1 +cmp(2.2, 2.2) = 0 +cmp(2.2, 2) = 1 +cmp(2.2, (2+4j)) = 1 +cmp(2.2, [1]) = -108 +cmp(2.2, (2,)) = -116 +cmp(2.2, None) = -78 +cmp(2.2, <Empty>) = -1 +cmp(2.2, <Coerce 3>) = -1 +cmp(2.2, <Cmp 4>) = -1 +cmp(2.2, <RCmp 5>) = -1 +cmp(2, 2) = 0 +cmp(2, 2.2) = -1 +cmp(2, 2) = 0 +cmp(2, (2+4j)) = -1 +cmp(2, [1]) = -108 +cmp(2, (2,)) = -116 +cmp(2, None) = -78 +cmp(2, <Empty>) = -1 +cmp(2, <Coerce 3>) = -1 +cmp(2, <Cmp 4>) = -1 +cmp(2, <RCmp 5>) = -1 +cmp((2+4j), 2) = 1 +cmp((2+4j), 2.2) = -1 +cmp((2+4j), 2) = 1 +cmp((2+4j), (2+4j)) = 0 +cmp((2+4j), [1]) = -108 +cmp((2+4j), (2,)) = -116 +cmp((2+4j), None) = -78 +cmp((2+4j), <Empty>) = -1 +cmp((2+4j), <Coerce 3>) = -1 +cmp((2+4j), <Cmp 4>) = -1 +cmp((2+4j), <RCmp 5>) = -1 +cmp([1], 2) = 108 +cmp([1], 2.2) = 108 +cmp([1], 2) = 108 +cmp([1], (2+4j)) = 108 +cmp([1], [1]) = 0 +cmp([1], (2,)) = -8 +cmp([1], None) = 30 +cmp([1], <Empty>) = -1 +cmp([1], <Coerce 3>) = 1 +cmp([1], <Cmp 4>) = 1 +cmp([1], <RCmp 5>) = -1 +cmp((2,), 2) = 116 +cmp((2,), 2.2) = 116 +cmp((2,), 2) = 116 +cmp((2,), (2+4j)) = 116 +cmp((2,), [1]) = 8 +cmp((2,), (2,)) = 0 +cmp((2,), None) = 38 +cmp((2,), <Empty>) = -1 +cmp((2,), <Coerce 3>) = 1 +cmp((2,), <Cmp 4>) = 1 +cmp((2,), <RCmp 5>) = -1 +cmp(None, 2) = 78 +cmp(None, 2.2) = 78 +cmp(None, 2) = 78 +cmp(None, (2+4j)) = 78 +cmp(None, [1]) = -30 +cmp(None, (2,)) = -38 +cmp(None, None) = 0 +cmp(None, <Empty>) = -1 +cmp(None, <Coerce 3>) = 1 +cmp(None, <Cmp 4>) = 1 +cmp(None, <RCmp 5>) = -1 +cmp(<Empty>, 2) = 1 +cmp(<Empty>, 2.2) = 1 +cmp(<Empty>, 2) = 1 +cmp(<Empty>, (2+4j)) = 1 +cmp(<Empty>, [1]) = 1 +cmp(<Empty>, (2,)) = 1 +cmp(<Empty>, None) = 1 +cmp(<Empty>, <Empty>) = 0 +cmp(<Empty>, <Coerce 3>) = -1 +cmp(<Empty>, <Cmp 4>) = -1 +cmp(<Empty>, <RCmp 5>) = 1 +cmp(<Coerce 3>, 2) = 1 +cmp(<Coerce 3>, 2.2) = 1 +cmp(<Coerce 3>, 2) = 1 +cmp(<Coerce 3>, (2+4j)) = 1 +cmp(<Coerce 3>, [1]) = -1 +cmp(<Coerce 3>, (2,)) = -1 +cmp(<Coerce 3>, None) = -1 +cmp(<Coerce 3>, <Empty>) = 1 +cmp(<Coerce 3>, <Coerce 3>) = 0 +cmp(<Coerce 3>, <Cmp 4>) = -1 +cmp(<Coerce 3>, <RCmp 5>) = -1 +cmp(<Cmp 4>, 2) = 1 +cmp(<Cmp 4>, 2.2) = 1 +cmp(<Cmp 4>, 2) = 1 +cmp(<Cmp 4>, (2+4j)) = 1 +cmp(<Cmp 4>, [1]) = -1 +cmp(<Cmp 4>, (2,)) = -1 +cmp(<Cmp 4>, None) = -1 +cmp(<Cmp 4>, <Empty>) = -1 +cmp(<Cmp 4>, <Coerce 3>) = 1 +cmp(<Cmp 4>, <Cmp 4>) = 0 +cmp(<Cmp 4>, <RCmp 5>) = -1 +cmp(<RCmp 5>, 2) = 1 +cmp(<RCmp 5>, 2.2) = 1 +cmp(<RCmp 5>, 2) = 1 +cmp(<RCmp 5>, (2+4j)) = 1 +cmp(<RCmp 5>, [1]) = 1 +cmp(<RCmp 5>, (2,)) = 1 +cmp(<RCmp 5>, None) = 1 +cmp(<RCmp 5>, <Empty>) = 1 +cmp(<RCmp 5>, <Coerce 3>) = 1 +cmp(<RCmp 5>, <Cmp 4>) = 1 +cmp(<RCmp 5>, <RCmp 5>) = 0 diff --git a/Lib/test/test_coercion.py b/Lib/test/test_coercion.py new file mode 100644 index 0000000..03d6b9b --- /dev/null +++ b/Lib/test/test_coercion.py @@ -0,0 +1,113 @@ +import copy +import sys + +# Fake a number that implements numeric methods through __coerce__ +class CoerceNumber: + def __init__(self, arg): + self.arg = arg + + def __repr__(self): + return '<CoerceNumber %s>' % repr(self.arg) + + def __coerce__(self, other): + if isinstance(other, CoerceNumber): + return self.arg, other.arg + else: + return (self.arg, other) + + +# Fake a number that implements numeric ops through methods. +class MethodNumber: + + def __init__(self,arg): + self.arg = arg + + def __repr__(self): + return '<MethodNumber %s>' % repr(self.arg) + + def __add__(self,other): + return self.arg + other + + def __radd__(self,other): + return other + self.arg + + def __sub__(self,other): + return self.arg - other + + def __rsub__(self,other): + return other - self.arg + + def __mul__(self,other): + return self.arg * other + + def __rmul__(self,other): + return other * self.arg + + def __div__(self,other): + return self.arg / other + + def __rdiv__(self,other): + return other / self.arg + + def __pow__(self,other): + return self.arg ** other + + def __rpow__(self,other): + return other ** self.arg + + def __mod__(self,other): + return self.arg % other + + def __rmod__(self,other): + return other % self.arg + + def __cmp__(self, other): + return cmp(self.arg, other) + + +candidates = [ 2, 2.2, 2L, 2+4j, [1], (2,), None, + MethodNumber(1), CoerceNumber(8)] + +infix_binops = [ '+', '-', '*', '/', '**', '%' ] +prefix_binops = [ 'divmod' ] + +def do_infix_binops(): + for a in candidates: + for b in candidates: + for op in infix_binops: + print '%s %s %s' % (a, op, b), + try: + x = eval('a %s b' % op) + except: + error = sys.exc_info()[:2] + print '... %s' % error[0] + else: + print '=', x + try: + z = copy.copy(a) + except copy.Error: + z = a # assume it has no inplace ops + print '%s %s= %s' % (a, op, b), + try: + exec('z %s= b' % op) + except: + error = sys.exc_info()[:2] + print '... %s' % error[0] + else: + print '=>', z + +def do_prefix_binops(): + for a in candidates: + for b in candidates: + for op in prefix_binops: + print '%s(%s, %s)' % (op, a, b), + try: + x = eval('%s(a, b)' % op) + except: + error = sys.exc_info()[:2] + print '... %s' % error[0] + else: + print '=', x + +do_infix_binops() +do_prefix_binops() diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py new file mode 100644 index 0000000..d74f300 --- /dev/null +++ b/Lib/test/test_compare.py @@ -0,0 +1,57 @@ +import sys + +from test_support import * + +class Empty: + def __repr__(self): + return '<Empty>' + +class Coerce: + def __init__(self, arg): + self.arg = arg + + def __repr__(self): + return '<Coerce %s>' % self.arg + + def __coerce__(self, other): + if isinstance(other, Coerce): + return self.arg, other.arg + else: + return (self.arg, other) + +class Cmp: + def __init__(self,arg): + self.arg = arg + + def __repr__(self): + return '<Cmp %s>' % self.arg + + def __cmp__(self, other): + return cmp(self.arg, other) + +class RCmp: + def __init__(self,arg): + self.arg = arg + + def __repr__(self): + return '<RCmp %s>' % self.arg + + def __rcmp__(self, other): + return cmp(other, self.arg) + + +candidates = [2, 2.2, 2L, 2+4j, [1], (2,), None, Empty(), Coerce(3), + Cmp(4), RCmp(5)] + +def test(): + for a in candidates: + for b in candidates: + print "cmp(%s, %s)" % (a, b), + try: + x = cmp(a, b) + except: + print '... %s' % sys.exc_info(0) + else: + print '=', x + +test() |