Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6cbba50a
Kaydet (Commit)
6cbba50a
authored
Mar 10, 2004
tarafından
Neil Schemenauer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make test_coercion.py less sensitive to platform fp quirks. Closes
SF bug #678265.
üst
66d31f8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
348 additions
and
333 deletions
+348
-333
test_coercion
Lib/test/output/test_coercion
+329
-329
test_coercion.py
Lib/test/test_coercion.py
+19
-4
No files found.
Lib/test/output/test_coercion
Dosyayı görüntüle @
6cbba50a
...
...
@@ -35,18 +35,18 @@ test_coercion
2 **= 2 => 4
2 % 2 = 0
2 %= 2 => 0
2 + (2+0j) = (4
+
0j)
2 += (2+0j) => (4
+
0j)
2 - (2+0j) =
0j
2 -= (2+0j) =>
0j
2 * (2+0j) = (4
+
0j)
2 *= (2+0j) => (4
+
0j)
2 / (2+0j) = (1
+
0j)
2 /= (2+0j) => (1
+
0j)
2 ** (2+0j) = (4
+
0j)
2 **= (2+0j) => (4
+
0j)
2 % (2+0j) =
0j
2 %= (2+0j) =>
0j
2 + (2+0j) = (4
.0 + 0.
0j)
2 += (2+0j) => (4
.0 + 0.
0j)
2 - (2+0j) =
(0.0 + 0.0j)
2 -= (2+0j) =>
(0.0 + 0.0j)
2 * (2+0j) = (4
.0 + 0.
0j)
2 *= (2+0j) => (4
.0 + 0.
0j)
2 / (2+0j) = (1
.0 + 0.
0j)
2 /= (2+0j) => (1
.0 + 0.
0j)
2 ** (2+0j) = (4
.0 + 0.
0j)
2 **= (2+0j) => (4
.0 + 0.
0j)
2 % (2+0j) =
(0.0 + 0.0j)
2 %= (2+0j) =>
(0.0 + 0.0j)
2 + [1] ... exceptions.TypeError
2 += [1] ... exceptions.TypeError
2 - [1] ... exceptions.TypeError
...
...
@@ -83,18 +83,18 @@ test_coercion
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 + <MethodNumber
2> = 4
2 += <MethodNumber
2> => 4
2 - <MethodNumber
2> = 0
2 -= <MethodNumber
2> => 0
2 * <MethodNumber
2> = 4
2 *= <MethodNumber
2> => 4
2 / <MethodNumber
2> = 1
2 /= <MethodNumber
2> => 1
2 ** <MethodNumber
2> = 4
2 **= <MethodNumber
2> => 4
2 % <MethodNumber
2
> = 0
2 %= <MethodNumber
2
> => 0
2 + <CoerceNumber 2> = 4
2 += <CoerceNumber 2> => 4
2 - <CoerceNumber 2> = 0
...
...
@@ -143,18 +143,18 @@ test_coercion
4.0 **= 2 => 16.0
4.0 % 2 = 0.0
4.0 %= 2 => 0.0
4.0 + (2+0j) = (6
+
0j)
4.0 += (2+0j) => (6
+
0j)
4.0 - (2+0j) = (2
+
0j)
4.0 -= (2+0j) => (2
+
0j)
4.0 * (2+0j) = (8
+
0j)
4.0 *= (2+0j) => (8
+
0j)
4.0 / (2+0j) = (2
+
0j)
4.0 /= (2+0j) => (2
+
0j)
4.0 ** (2+0j) = (16
+
0j)
4.0 **= (2+0j) => (16
+
0j)
4.0 % (2+0j) =
0j
4.0 %= (2+0j) =>
0j
4.0 + (2+0j) = (6
.0 + 0.
0j)
4.0 += (2+0j) => (6
.0 + 0.
0j)
4.0 - (2+0j) = (2
.0 + 0.
0j)
4.0 -= (2+0j) => (2
.0 + 0.
0j)
4.0 * (2+0j) = (8
.0 + 0.
0j)
4.0 *= (2+0j) => (8
.0 + 0.
0j)
4.0 / (2+0j) = (2
.0 + 0.
0j)
4.0 /= (2+0j) => (2
.0 + 0.
0j)
4.0 ** (2+0j) = (16
.0 + 0.
0j)
4.0 **= (2+0j) => (16
.0 + 0.
0j)
4.0 % (2+0j) =
(0.0 + 0.0j)
4.0 %= (2+0j) =>
(0.0 + 0.0j)
4.0 + [1] ... exceptions.TypeError
4.0 += [1] ... exceptions.TypeError
4.0 - [1] ... exceptions.TypeError
...
...
@@ -191,18 +191,18 @@ test_coercion
4.0 **= None ... exceptions.TypeError
4.0 % None ... exceptions.TypeError
4.0 %= None ... exceptions.TypeError
4.0 + <MethodNumber
1> = 5
.0
4.0 += <MethodNumber
1> => 5
.0
4.0 - <MethodNumber
1> = 3
.0
4.0 -= <MethodNumber
1> => 3
.0
4.0 * <MethodNumber
1> = 4
.0
4.0 *= <MethodNumber
1> => 4
.0
4.0 / <MethodNumber
1> = 4
.0
4.0 /= <MethodNumber
1> => 4
.0
4.0 ** <MethodNumber
1> = 4
.0
4.0 **= <MethodNumber
1> => 4
.0
4.0 % <MethodNumber
1
> = 0.0
4.0 %= <MethodNumber
1
> => 0.0
4.0 + <MethodNumber
2> = 6
.0
4.0 += <MethodNumber
2> => 6
.0
4.0 - <MethodNumber
2> = 2
.0
4.0 -= <MethodNumber
2> => 2
.0
4.0 * <MethodNumber
2> = 8
.0
4.0 *= <MethodNumber
2> => 8
.0
4.0 / <MethodNumber
2> = 2
.0
4.0 /= <MethodNumber
2> => 2
.0
4.0 ** <MethodNumber
2> = 16
.0
4.0 **= <MethodNumber
2> => 16
.0
4.0 % <MethodNumber
2
> = 0.0
4.0 %= <MethodNumber
2
> => 0.0
4.0 + <CoerceNumber 2> = 6.0
4.0 += <CoerceNumber 2> => 6.0
4.0 - <CoerceNumber 2> = 2.0
...
...
@@ -251,18 +251,18 @@ test_coercion
2 **= 2 => 4
2 % 2 = 0
2 %= 2 => 0
2 + (2+0j) = (4
+
0j)
2 += (2+0j) => (4
+
0j)
2 - (2+0j) =
0j
2 -= (2+0j) =>
0j
2 * (2+0j) = (4
+
0j)
2 *= (2+0j) => (4
+
0j)
2 / (2+0j) = (1
+
0j)
2 /= (2+0j) => (1
+
0j)
2 ** (2+0j) = (4
+
0j)
2 **= (2+0j) => (4
+
0j)
2 % (2+0j) =
0j
2 %= (2+0j) =>
0j
2 + (2+0j) = (4
.0 + 0.
0j)
2 += (2+0j) => (4
.0 + 0.
0j)
2 - (2+0j) =
(0.0 + 0.0j)
2 -= (2+0j) =>
(0.0 + 0.0j)
2 * (2+0j) = (4
.0 + 0.
0j)
2 *= (2+0j) => (4
.0 + 0.
0j)
2 / (2+0j) = (1
.0 + 0.
0j)
2 /= (2+0j) => (1
.0 + 0.
0j)
2 ** (2+0j) = (4
.0 + 0.
0j)
2 **= (2+0j) => (4
.0 + 0.
0j)
2 % (2+0j) =
(0.0 + 0.0j)
2 %= (2+0j) =>
(0.0 + 0.0j)
2 + [1] ... exceptions.TypeError
2 += [1] ... exceptions.TypeError
2 - [1] ... exceptions.TypeError
...
...
@@ -299,18 +299,18 @@ test_coercion
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 + <MethodNumber
2> = 4
2 += <MethodNumber
2> => 4
2 - <MethodNumber
2> = 0
2 -= <MethodNumber
2> => 0
2 * <MethodNumber
2> = 4
2 *= <MethodNumber
2> => 4
2 / <MethodNumber
2> = 1
2 /= <MethodNumber
2> => 1
2 ** <MethodNumber
2> = 4
2 **= <MethodNumber
2> => 4
2 % <MethodNumber
2
> = 0
2 %= <MethodNumber
2
> => 0
2 + <CoerceNumber 2> = 4
2 += <CoerceNumber 2> => 4
2 - <CoerceNumber 2> = 0
...
...
@@ -323,54 +323,54 @@ test_coercion
2 **= <CoerceNumber 2> => 4
2 % <CoerceNumber 2> = 0
2 %= <CoerceNumber 2> => 0
(2+0j) + 2 = (4
+
0j)
(2+0j) += 2 => (4
+
0j)
(2+0j) - 2 =
0j
(2+0j) -= 2 =>
0j
(2+0j) * 2 = (4
+
0j)
(2+0j) *= 2 => (4
+
0j)
(2+0j) / 2 = (1
+
0j)
(2+0j) /= 2 => (1
+
0j)
(2+0j) ** 2 = (4
+
0j)
(2+0j) **= 2 => (4
+
0j)
(2+0j) % 2 =
0j
(2+0j) %= 2 =>
0j
(2+0j) + 4.0 = (6
+
0j)
(2+0j) += 4.0 => (6
+
0j)
(2+0j) - 4.0 = (-2
+
0j)
(2+0j) -= 4.0 => (-2
+
0j)
(2+0j) * 4.0 = (8
+
0j)
(2+0j) *= 4.0 => (8
+
0j)
(2+0j) / 4.0 = (0.5
+
0j)
(2+0j) /= 4.0 => (0.5
+
0j)
(2+0j) ** 4.0 = (16
+
0j)
(2+0j) **= 4.0 => (16
+
0j)
(2+0j) % 4.0 = (2
+
0j)
(2+0j) %= 4.0 => (2
+
0j)
(2+0j) + 2 = (4
+
0j)
(2+0j) += 2 => (4
+
0j)
(2+0j) - 2 =
0j
(2+0j) -= 2 =>
0j
(2+0j) * 2 = (4
+
0j)
(2+0j) *= 2 => (4
+
0j)
(2+0j) / 2 = (1
+
0j)
(2+0j) /= 2 => (1
+
0j)
(2+0j) ** 2 = (4
+
0j)
(2+0j) **= 2 => (4
+
0j)
(2+0j) % 2 =
0j
(2+0j) %= 2 =>
0j
(2+0j) + (2+0j) = (4
+
0j)
(2+0j) += (2+0j) => (4
+
0j)
(2+0j) - (2+0j) =
0j
(2+0j) -= (2+0j) =>
0j
(2+0j) * (2+0j) = (4
+
0j)
(2+0j) *= (2+0j) => (4
+
0j)
(2+0j) / (2+0j) = (1
+
0j)
(2+0j) /= (2+0j) => (1
+
0j)
(2+0j) ** (2+0j) = (4
+
0j)
(2+0j) **= (2+0j) => (4
+
0j)
(2+0j) % (2+0j) =
0j
(2+0j) %= (2+0j) =>
0j
(2+0j) + 2 = (4
.0 + 0.
0j)
(2+0j) += 2 => (4
.0 + 0.
0j)
(2+0j) - 2 =
(0.0 + 0.0j)
(2+0j) -= 2 =>
(0.0 + 0.0j)
(2+0j) * 2 = (4
.0 + 0.
0j)
(2+0j) *= 2 => (4
.0 + 0.
0j)
(2+0j) / 2 = (1
.0 + 0.
0j)
(2+0j) /= 2 => (1
.0 + 0.
0j)
(2+0j) ** 2 = (4
.0 + 0.
0j)
(2+0j) **= 2 => (4
.0 + 0.
0j)
(2+0j) % 2 =
(0.0 + 0.0j)
(2+0j) %= 2 =>
(0.0 + 0.0j)
(2+0j) + 4.0 = (6
.0 + 0.
0j)
(2+0j) += 4.0 => (6
.0 + 0.
0j)
(2+0j) - 4.0 = (-2
.0 + 0.
0j)
(2+0j) -= 4.0 => (-2
.0 + 0.
0j)
(2+0j) * 4.0 = (8
.0 + 0.
0j)
(2+0j) *= 4.0 => (8
.0 + 0.
0j)
(2+0j) / 4.0 = (0.5
+ 0.
0j)
(2+0j) /= 4.0 => (0.5
+ 0.
0j)
(2+0j) ** 4.0 = (16
.0 + 0.
0j)
(2+0j) **= 4.0 => (16
.0 + 0.
0j)
(2+0j) % 4.0 = (2
.0 + 0.
0j)
(2+0j) %= 4.0 => (2
.0 + 0.
0j)
(2+0j) + 2 = (4
.0 + 0.
0j)
(2+0j) += 2 => (4
.0 + 0.
0j)
(2+0j) - 2 =
(0.0 + 0.0j)
(2+0j) -= 2 =>
(0.0 + 0.0j)
(2+0j) * 2 = (4
.0 + 0.
0j)
(2+0j) *= 2 => (4
.0 + 0.
0j)
(2+0j) / 2 = (1
.0 + 0.
0j)
(2+0j) /= 2 => (1
.0 + 0.
0j)
(2+0j) ** 2 = (4
.0 + 0.
0j)
(2+0j) **= 2 => (4
.0 + 0.
0j)
(2+0j) % 2 =
(0.0 + 0.0j)
(2+0j) %= 2 =>
(0.0 + 0.0j)
(2+0j) + (2+0j) = (4
.0 + 0.
0j)
(2+0j) += (2+0j) => (4
.0 + 0.
0j)
(2+0j) - (2+0j) =
(0.0 + 0.0j)
(2+0j) -= (2+0j) =>
(0.0 + 0.0j)
(2+0j) * (2+0j) = (4
.0 + 0.
0j)
(2+0j) *= (2+0j) => (4
.0 + 0.
0j)
(2+0j) / (2+0j) = (1
.0 + 0.
0j)
(2+0j) /= (2+0j) => (1
.0 + 0.
0j)
(2+0j) ** (2+0j) = (4
.0 + 0.
0j)
(2+0j) **= (2+0j) => (4
.0 + 0.
0j)
(2+0j) % (2+0j) =
(0.0 + 0.0j)
(2+0j) %= (2+0j) =>
(0.0 + 0.0j)
(2+0j) + [1] ... exceptions.TypeError
(2+0j) += [1] ... exceptions.TypeError
(2+0j) - [1] ... exceptions.TypeError
...
...
@@ -407,30 +407,30 @@ test_coercion
(2+0j) **= None ... exceptions.TypeError
(2+0j) % None ... exceptions.TypeError
(2+0j) %= None ... exceptions.TypeError
(2+0j) + <MethodNumber
1> = (3+
0j)
(2+0j) += <MethodNumber
1> => (3+
0j)
(2+0j) - <MethodNumber
1> = (1+
0j)
(2+0j) -= <MethodNumber
1> => (1+
0j)
(2+0j) * <MethodNumber
1> = (2+
0j)
(2+0j) *= <MethodNumber
1> => (2+
0j)
(2+0j) / <MethodNumber
1> = (2+
0j)
(2+0j) /= <MethodNumber
1> => (2+
0j)
(2+0j) ** <MethodNumber
1> = (2+
0j)
(2+0j) **= <MethodNumber
1> => (2+
0j)
(2+0j) % <MethodNumber
1> = 0j
(2+0j) %= <MethodNumber
1> => 0j
(2+0j) + <CoerceNumber 2> = (4
+
0j)
(2+0j) += <CoerceNumber 2> => (4
+
0j)
(2+0j) - <CoerceNumber 2> =
0j
(2+0j) -= <CoerceNumber 2> =>
0j
(2+0j) * <CoerceNumber 2> = (4
+
0j)
(2+0j) *= <CoerceNumber 2> => (4
+
0j)
(2+0j) / <CoerceNumber 2> = (1
+
0j)
(2+0j) /= <CoerceNumber 2> => (1
+
0j)
(2+0j) ** <CoerceNumber 2> = (4
+
0j)
(2+0j) **= <CoerceNumber 2> => (4
+
0j)
(2+0j) % <CoerceNumber 2> =
0j
(2+0j) %= <CoerceNumber 2> =>
0j
(2+0j) + <MethodNumber
2> = (4.0 + 0.
0j)
(2+0j) += <MethodNumber
2> => (4.0 + 0.
0j)
(2+0j) - <MethodNumber
2> = (0.0 + 0.
0j)
(2+0j) -= <MethodNumber
2> => (0.0 + 0.
0j)
(2+0j) * <MethodNumber
2> = (4.0 + 0.
0j)
(2+0j) *= <MethodNumber
2> => (4.0 + 0.
0j)
(2+0j) / <MethodNumber
2> = (1.0 + 0.
0j)
(2+0j) /= <MethodNumber
2> => (1.0 + 0.
0j)
(2+0j) ** <MethodNumber
2> = (4.0 + 0.
0j)
(2+0j) **= <MethodNumber
2> => (4.0 + 0.
0j)
(2+0j) % <MethodNumber
2> = (0.0 + 0.0j)
(2+0j) %= <MethodNumber
2> => (0.0 + 0.0j)
(2+0j) + <CoerceNumber 2> = (4
.0 + 0.
0j)
(2+0j) += <CoerceNumber 2> => (4
.0 + 0.
0j)
(2+0j) - <CoerceNumber 2> =
(0.0 + 0.0j)
(2+0j) -= <CoerceNumber 2> =>
(0.0 + 0.0j)
(2+0j) * <CoerceNumber 2> = (4
.0 + 0.
0j)
(2+0j) *= <CoerceNumber 2> => (4
.0 + 0.
0j)
(2+0j) / <CoerceNumber 2> = (1
.0 + 0.
0j)
(2+0j) /= <CoerceNumber 2> => (1
.0 + 0.
0j)
(2+0j) ** <CoerceNumber 2> = (4
.0 + 0.
0j)
(2+0j) **= <CoerceNumber 2> => (4
.0 + 0.
0j)
(2+0j) % <CoerceNumber 2> =
(0.0 + 0.0j)
(2+0j) %= <CoerceNumber 2> =>
(0.0 + 0.0j)
[1] + 2 ... exceptions.TypeError
[1] += 2 ... exceptions.TypeError
[1] - 2 ... exceptions.TypeError
...
...
@@ -515,18 +515,18 @@ test_coercion
[1] **= None ... exceptions.TypeError
[1] % None ... exceptions.TypeError
[1] %= None ... 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> = [
1]
[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
2
> ... exceptions.TypeError
[1] += <MethodNumber
2
> ... exceptions.TypeError
[1] - <MethodNumber
2
> ... exceptions.TypeError
[1] -= <MethodNumber
2
> ... exceptions.TypeError
[1] * <MethodNumber
2> = [1,
1]
[1] *= <MethodNumber
2> => [1,
1]
[1] / <MethodNumber
2
> ... exceptions.TypeError
[1] /= <MethodNumber
2
> ... exceptions.TypeError
[1] ** <MethodNumber
2
> ... exceptions.TypeError
[1] **= <MethodNumber
2
> ... exceptions.TypeError
[1] % <MethodNumber
2
> ... exceptions.TypeError
[1] %= <MethodNumber
2
> ... exceptions.TypeError
[1] + <CoerceNumber 2> ... exceptions.TypeError
[1] += <CoerceNumber 2> ... exceptions.TypeError
[1] - <CoerceNumber 2> ... exceptions.TypeError
...
...
@@ -623,18 +623,18 @@ test_coercion
(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,) + <MethodNumber
2
> ... exceptions.TypeError
(2,) += <MethodNumber
2
> ... exceptions.TypeError
(2,) - <MethodNumber
2
> ... exceptions.TypeError
(2,) -= <MethodNumber
2
> ... exceptions.TypeError
(2,) * <MethodNumber
2> = (2, 2
)
(2,) *= <MethodNumber
2> => (2, 2
)
(2,) / <MethodNumber
2
> ... exceptions.TypeError
(2,) /= <MethodNumber
2
> ... exceptions.TypeError
(2,) ** <MethodNumber
2
> ... exceptions.TypeError
(2,) **= <MethodNumber
2
> ... exceptions.TypeError
(2,) % <MethodNumber
2
> ... exceptions.TypeError
(2,) %= <MethodNumber
2
> ... exceptions.TypeError
(2,) + <CoerceNumber 2> ... exceptions.TypeError
(2,) += <CoerceNumber 2> ... exceptions.TypeError
(2,) - <CoerceNumber 2> ... exceptions.TypeError
...
...
@@ -731,18 +731,18 @@ 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 + <MethodNumber
2
> ... exceptions.TypeError
None += <MethodNumber
2
> ... exceptions.TypeError
None - <MethodNumber
2
> ... exceptions.TypeError
None -= <MethodNumber
2
> ... exceptions.TypeError
None * <MethodNumber
2
> ... exceptions.TypeError
None *= <MethodNumber
2
> ... exceptions.TypeError
None / <MethodNumber
2
> ... exceptions.TypeError
None /= <MethodNumber
2
> ... exceptions.TypeError
None ** <MethodNumber
2
> ... exceptions.TypeError
None **= <MethodNumber
2
> ... exceptions.TypeError
None % <MethodNumber
2
> ... exceptions.TypeError
None %= <MethodNumber
2
> ... exceptions.TypeError
None + <CoerceNumber 2> ... exceptions.TypeError
None += <CoerceNumber 2> ... exceptions.TypeError
None - <CoerceNumber 2> ... exceptions.TypeError
...
...
@@ -755,114 +755,114 @@ None ** <CoerceNumber 2> ... exceptions.TypeError
None **= <CoerceNumber 2> ... exceptions.TypeError
None % <CoerceNumber 2> ... exceptions.TypeError
None %= <CoerceNumber 2> ... 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> + 4.0 = 5
.0
<MethodNumber
1> += 4.0 => 5
.0
<MethodNumber
1> - 4.0 = -3
.0
<MethodNumber
1> -= 4.0 => -3
.0
<MethodNumber
1> * 4.0 = 4
.0
<MethodNumber
1> *= 4.0 => 4
.0
<MethodNumber
1> / 4.0 = 0.2
5
<MethodNumber
1> /= 4.0 => 0.2
5
<MethodNumber
1> ** 4.0 = 1
.0
<MethodNumber
1> **= 4.0 => 1
.0
<MethodNumber
1> % 4.0 = 1
.0
<MethodNumber
1> %= 4.0 => 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+0j) = (3+
0j)
<MethodNumber
1> += (2+0j) => (3+
0j)
<MethodNumber
1> - (2+0j) = (-1+
0j)
<MethodNumber
1> -= (2+0j) => (-1+
0j)
<MethodNumber
1> * (2+0j) = (2+
0j)
<MethodNumber
1> *= (2+0j) => (2+
0j)
<MethodNumber
1> / (2+0j) = (0.5+
0j)
<MethodNumber
1> /= (2+0j) => (0.5+
0j)
<MethodNumber
1> ** (2+0j) = (1+
0j)
<MethodNumber
1> **= (2+0j) => (1+
0j)
<MethodNumber
1> % (2+0j) = (1+
0j)
<MethodNumber
1> %= (2+0j) => (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 2> = 3
<MethodNumber
1> += <CoerceNumber 2> => 3
<MethodNumber
1> - <CoerceNumber 2> = -1
<MethodNumber
1> -= <CoerceNumber 2> => -1
<MethodNumber
1> * <CoerceNumber 2> = 2
<MethodNumber
1> *= <CoerceNumber 2> => 2
<MethodNumber
1> / <CoerceNumber 2> = 0
<MethodNumber
1> /= <CoerceNumber 2> => 0
<MethodNumber
1> ** <CoerceNumber 2> = 1
<MethodNumber
1> **= <CoerceNumber 2> => 1
<MethodNumber
1> % <CoerceNumber 2> = 1
<MethodNumber
1> %= <CoerceNumber 2> => 1
<MethodNumber
2> + 2 = 4
<MethodNumber
2> += 2 => 4
<MethodNumber
2> - 2 = 0
<MethodNumber
2> -= 2 => 0
<MethodNumber
2> * 2 = 4
<MethodNumber
2> *= 2 => 4
<MethodNumber
2> / 2 = 1
<MethodNumber
2> /= 2 => 1
<MethodNumber
2> ** 2 = 4
<MethodNumber
2> **= 2 => 4
<MethodNumber
2> % 2 = 0
<MethodNumber
2> %= 2 => 0
<MethodNumber
2> + 4.0 = 6
.0
<MethodNumber
2> += 4.0 => 6
.0
<MethodNumber
2> - 4.0 = -2
.0
<MethodNumber
2> -= 4.0 => -2
.0
<MethodNumber
2> * 4.0 = 8
.0
<MethodNumber
2> *= 4.0 => 8
.0
<MethodNumber
2> / 4.0 = 0.
5
<MethodNumber
2> /= 4.0 => 0.
5
<MethodNumber
2> ** 4.0 = 16
.0
<MethodNumber
2> **= 4.0 => 16
.0
<MethodNumber
2> % 4.0 = 2
.0
<MethodNumber
2> %= 4.0 => 2
.0
<MethodNumber
2> + 2 = 4
<MethodNumber
2> += 2 => 4
<MethodNumber
2> - 2 = 0
<MethodNumber
2> -= 2 => 0
<MethodNumber
2> * 2 = 4
<MethodNumber
2> *= 2 => 4
<MethodNumber
2> / 2 = 1
<MethodNumber
2> /= 2 => 1
<MethodNumber
2> ** 2 = 4
<MethodNumber
2> **= 2 => 4
<MethodNumber
2> % 2 = 0
<MethodNumber
2> %= 2 => 0
<MethodNumber
2> + (2+0j) = (4.0 + 0.
0j)
<MethodNumber
2> += (2+0j) => (4.0 + 0.
0j)
<MethodNumber
2> - (2+0j) = (0.0 + 0.
0j)
<MethodNumber
2> -= (2+0j) => (0.0 + 0.
0j)
<MethodNumber
2> * (2+0j) = (4.0 + 0.
0j)
<MethodNumber
2> *= (2+0j) => (4.0 + 0.
0j)
<MethodNumber
2> / (2+0j) = (1.0 + 0.
0j)
<MethodNumber
2> /= (2+0j) => (1.0 + 0.
0j)
<MethodNumber
2> ** (2+0j) = (4.0 + 0.
0j)
<MethodNumber
2> **= (2+0j) => (4.0 + 0.
0j)
<MethodNumber
2> % (2+0j) = (0.0 + 0.
0j)
<MethodNumber
2> %= (2+0j) => (0.0 + 0.
0j)
<MethodNumber
2
> + [1] ... exceptions.TypeError
<MethodNumber
2
> += [1] ... exceptions.TypeError
<MethodNumber
2
> - [1] ... exceptions.TypeError
<MethodNumber
2
> -= [1] ... exceptions.TypeError
<MethodNumber
2> * [1] = [1,
1]
<MethodNumber
2> *= [1] => [1,
1]
<MethodNumber
2
> / [1] ... exceptions.TypeError
<MethodNumber
2
> /= [1] ... exceptions.TypeError
<MethodNumber
2
> ** [1] ... exceptions.TypeError
<MethodNumber
2
> **= [1] ... exceptions.TypeError
<MethodNumber
2
> % [1] ... exceptions.TypeError
<MethodNumber
2
> %= [1] ... exceptions.TypeError
<MethodNumber
2
> + (2,) ... exceptions.TypeError
<MethodNumber
2
> += (2,) ... exceptions.TypeError
<MethodNumber
2
> - (2,) ... exceptions.TypeError
<MethodNumber
2
> -= (2,) ... exceptions.TypeError
<MethodNumber
2> * (2,) = (2, 2
)
<MethodNumber
2> *= (2,) => (2, 2
)
<MethodNumber
2
> / (2,) ... exceptions.TypeError
<MethodNumber
2
> /= (2,) ... exceptions.TypeError
<MethodNumber
2
> ** (2,) ... exceptions.TypeError
<MethodNumber
2
> **= (2,) ... exceptions.TypeError
<MethodNumber
2
> % (2,) ... exceptions.TypeError
<MethodNumber
2
> %= (2,) ... exceptions.TypeError
<MethodNumber
2
> + None ... exceptions.TypeError
<MethodNumber
2
> += None ... exceptions.TypeError
<MethodNumber
2
> - None ... exceptions.TypeError
<MethodNumber
2
> -= None ... exceptions.TypeError
<MethodNumber
2
> * None ... exceptions.TypeError
<MethodNumber
2
> *= None ... exceptions.TypeError
<MethodNumber
2
> / None ... exceptions.TypeError
<MethodNumber
2
> /= None ... exceptions.TypeError
<MethodNumber
2
> ** None ... exceptions.TypeError
<MethodNumber
2
> **= None ... exceptions.TypeError
<MethodNumber
2
> % None ... exceptions.TypeError
<MethodNumber
2
> %= None ... exceptions.TypeError
<MethodNumber
2> + <MethodNumber 2> = 4
<MethodNumber
2> += <MethodNumber 2> => 4
<MethodNumber
2> - <MethodNumber 2
> = 0
<MethodNumber
2> -= <MethodNumber 2
> => 0
<MethodNumber
2> * <MethodNumber 2> = 4
<MethodNumber
2> *= <MethodNumber 2> => 4
<MethodNumber
2> / <MethodNumber 2
> = 1
<MethodNumber
2> /= <MethodNumber 2
> => 1
<MethodNumber
2> ** <MethodNumber 2> = 4
<MethodNumber
2> **= <MethodNumber 2> => 4
<MethodNumber
2> % <MethodNumber 2
> = 0
<MethodNumber
2> %= <MethodNumber 2
> => 0
<MethodNumber
2> + <CoerceNumber 2> = 4
<MethodNumber
2> += <CoerceNumber 2> => 4
<MethodNumber
2> - <CoerceNumber 2> = 0
<MethodNumber
2> -= <CoerceNumber 2> => 0
<MethodNumber
2> * <CoerceNumber 2> = 4
<MethodNumber
2> *= <CoerceNumber 2> => 4
<MethodNumber
2> / <CoerceNumber 2> = 1
<MethodNumber
2> /= <CoerceNumber 2> => 1
<MethodNumber
2> ** <CoerceNumber 2> = 4
<MethodNumber
2> **= <CoerceNumber 2> => 4
<MethodNumber
2> % <CoerceNumber 2> = 0
<MethodNumber
2> %= <CoerceNumber 2> => 0
<CoerceNumber 2> + 2 = 4
<CoerceNumber 2> += 2 => 4
<CoerceNumber 2> - 2 = 0
...
...
@@ -899,18 +899,18 @@ None %= <CoerceNumber 2> ... exceptions.TypeError
<CoerceNumber 2> **= 2 => 4
<CoerceNumber 2> % 2 = 0
<CoerceNumber 2> %= 2 => 0
<CoerceNumber 2> + (2+0j) = (4
+
0j)
<CoerceNumber 2> += (2+0j) => (4
+
0j)
<CoerceNumber 2> - (2+0j) =
0j
<CoerceNumber 2> -= (2+0j) =>
0j
<CoerceNumber 2> * (2+0j) = (4
+
0j)
<CoerceNumber 2> *= (2+0j) => (4
+
0j)
<CoerceNumber 2> / (2+0j) = (1
+
0j)
<CoerceNumber 2> /= (2+0j) => (1
+
0j)
<CoerceNumber 2> ** (2+0j) = (4
+
0j)
<CoerceNumber 2> **= (2+0j) => (4
+
0j)
<CoerceNumber 2> % (2+0j) =
0j
<CoerceNumber 2> %= (2+0j) =>
0j
<CoerceNumber 2> + (2+0j) = (4
.0 + 0.
0j)
<CoerceNumber 2> += (2+0j) => (4
.0 + 0.
0j)
<CoerceNumber 2> - (2+0j) =
(0.0 + 0.0j)
<CoerceNumber 2> -= (2+0j) =>
(0.0 + 0.0j)
<CoerceNumber 2> * (2+0j) = (4
.0 + 0.
0j)
<CoerceNumber 2> *= (2+0j) => (4
.0 + 0.
0j)
<CoerceNumber 2> / (2+0j) = (1
.0 + 0.
0j)
<CoerceNumber 2> /= (2+0j) => (1
.0 + 0.
0j)
<CoerceNumber 2> ** (2+0j) = (4
.0 + 0.
0j)
<CoerceNumber 2> **= (2+0j) => (4
.0 + 0.
0j)
<CoerceNumber 2> % (2+0j) =
(0.0 + 0.0j)
<CoerceNumber 2> %= (2+0j) =>
(0.0 + 0.0j)
<CoerceNumber 2> + [1] ... exceptions.TypeError
<CoerceNumber 2> += [1] ... exceptions.TypeError
<CoerceNumber 2> - [1] ... exceptions.TypeError
...
...
@@ -947,18 +947,18 @@ None %= <CoerceNumber 2> ... exceptions.TypeError
<CoerceNumber 2> **= None ... exceptions.TypeError
<CoerceNumber 2> % None ... exceptions.TypeError
<CoerceNumber 2> %= None ... exceptions.TypeError
<CoerceNumber 2> + <MethodNumber
1> = 3
<CoerceNumber 2> += <MethodNumber
1> => 3
<CoerceNumber 2> - <MethodNumber
1> = 1
<CoerceNumber 2> -= <MethodNumber
1> => 1
<CoerceNumber 2> * <MethodNumber
1> = 2
<CoerceNumber 2> *= <MethodNumber
1> => 2
<CoerceNumber 2> / <MethodNumber
1> = 2
<CoerceNumber 2> /= <MethodNumber
1> => 2
<CoerceNumber 2> ** <MethodNumber
1> = 2
<CoerceNumber 2> **= <MethodNumber
1> => 2
<CoerceNumber 2> % <MethodNumber
1
> = 0
<CoerceNumber 2> %= <MethodNumber
1
> => 0
<CoerceNumber 2> + <MethodNumber
2> = 4
<CoerceNumber 2> += <MethodNumber
2> => 4
<CoerceNumber 2> - <MethodNumber
2> = 0
<CoerceNumber 2> -= <MethodNumber
2> => 0
<CoerceNumber 2> * <MethodNumber
2> = 4
<CoerceNumber 2> *= <MethodNumber
2> => 4
<CoerceNumber 2> / <MethodNumber
2> = 1
<CoerceNumber 2> /= <MethodNumber
2> => 1
<CoerceNumber 2> ** <MethodNumber
2> = 4
<CoerceNumber 2> **= <MethodNumber
2> => 4
<CoerceNumber 2> % <MethodNumber
2
> = 0
<CoerceNumber 2> %= <MethodNumber
2
> => 0
<CoerceNumber 2> + <CoerceNumber 2> = 4
<CoerceNumber 2> += <CoerceNumber 2> => 4
<CoerceNumber 2> - <CoerceNumber 2> = 0
...
...
@@ -978,7 +978,7 @@ divmod(2, (2+0j)) = ((1+0j), 0j)
divmod(2, [1]) ... exceptions.TypeError
divmod(2, (2,)) ... exceptions.TypeError
divmod(2, None) ... exceptions.TypeError
divmod(2, <MethodNumber
1
>) ... exceptions.TypeError
divmod(2, <MethodNumber
2
>) ... exceptions.TypeError
divmod(2, <CoerceNumber 2>) = (1, 0)
divmod(4.0, 2) = (2.0, 0.0)
divmod(4.0, 4.0) = (1.0, 0.0)
...
...
@@ -987,7 +987,7 @@ divmod(4.0, (2+0j)) = ((2+0j), 0j)
divmod(4.0, [1]) ... exceptions.TypeError
divmod(4.0, (2,)) ... exceptions.TypeError
divmod(4.0, None) ... exceptions.TypeError
divmod(4.0, <MethodNumber
1
>) ... exceptions.TypeError
divmod(4.0, <MethodNumber
2
>) ... exceptions.TypeError
divmod(4.0, <CoerceNumber 2>) = (2.0, 0.0)
divmod(2, 2) = (1L, 0L)
divmod(2, 4.0) = (0.0, 2.0)
...
...
@@ -996,7 +996,7 @@ divmod(2, (2+0j)) = ((1+0j), 0j)
divmod(2, [1]) ... exceptions.TypeError
divmod(2, (2,)) ... exceptions.TypeError
divmod(2, None) ... exceptions.TypeError
divmod(2, <MethodNumber
1
>) ... exceptions.TypeError
divmod(2, <MethodNumber
2
>) ... exceptions.TypeError
divmod(2, <CoerceNumber 2>) = (1L, 0L)
divmod((2+0j), 2) = ((1+0j), 0j)
divmod((2+0j), 4.0) = (0j, (2+0j))
...
...
@@ -1005,7 +1005,7 @@ divmod((2+0j), (2+0j)) = ((1+0j), 0j)
divmod((2+0j), [1]) ... exceptions.TypeError
divmod((2+0j), (2,)) ... exceptions.TypeError
divmod((2+0j), None) ... exceptions.TypeError
divmod((2+0j), <MethodNumber
1
>) ... exceptions.TypeError
divmod((2+0j), <MethodNumber
2
>) ... exceptions.TypeError
divmod((2+0j), <CoerceNumber 2>) = ((1+0j), 0j)
divmod([1], 2) ... exceptions.TypeError
divmod([1], 4.0) ... exceptions.TypeError
...
...
@@ -1014,7 +1014,7 @@ divmod([1], (2+0j)) ... 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], <MethodNumber
2
>) ... exceptions.TypeError
divmod([1], <CoerceNumber 2>) ... exceptions.TypeError
divmod((2,), 2) ... exceptions.TypeError
divmod((2,), 4.0) ... exceptions.TypeError
...
...
@@ -1023,7 +1023,7 @@ divmod((2,), (2+0j)) ... 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,), <MethodNumber
2
>) ... exceptions.TypeError
divmod((2,), <CoerceNumber 2>) ... exceptions.TypeError
divmod(None, 2) ... exceptions.TypeError
divmod(None, 4.0) ... exceptions.TypeError
...
...
@@ -1032,17 +1032,17 @@ divmod(None, (2+0j)) ... 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, <MethodNumber
2
>) ... exceptions.TypeError
divmod(None, <CoerceNumber 2>) ... exceptions.TypeError
divmod(<MethodNumber
1
>, 2) ... exceptions.TypeError
divmod(<MethodNumber
1
>, 4.0) ... exceptions.TypeError
divmod(<MethodNumber
1
>, 2) ... exceptions.TypeError
divmod(<MethodNumber
1
>, (2+0j)) ... 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 2>) ... exceptions.TypeError
divmod(<MethodNumber
2
>, 2) ... exceptions.TypeError
divmod(<MethodNumber
2
>, 4.0) ... exceptions.TypeError
divmod(<MethodNumber
2
>, 2) ... exceptions.TypeError
divmod(<MethodNumber
2
>, (2+0j)) ... exceptions.TypeError
divmod(<MethodNumber
2
>, [1]) ... exceptions.TypeError
divmod(<MethodNumber
2
>, (2,)) ... exceptions.TypeError
divmod(<MethodNumber
2
>, None) ... exceptions.TypeError
divmod(<MethodNumber
2>, <MethodNumber 2
>) ... exceptions.TypeError
divmod(<MethodNumber
2
>, <CoerceNumber 2>) ... exceptions.TypeError
divmod(<CoerceNumber 2>, 2) = (1, 0)
divmod(<CoerceNumber 2>, 4.0) = (0.0, 2.0)
divmod(<CoerceNumber 2>, 2) = (1L, 0L)
...
...
@@ -1050,5 +1050,5 @@ divmod(<CoerceNumber 2>, (2+0j)) = ((1+0j), 0j)
divmod(<CoerceNumber 2>, [1]) ... exceptions.TypeError
divmod(<CoerceNumber 2>, (2,)) ... exceptions.TypeError
divmod(<CoerceNumber 2>, None) ... exceptions.TypeError
divmod(<CoerceNumber 2>, <MethodNumber
1
>) ... exceptions.TypeError
divmod(<CoerceNumber 2>, <MethodNumber
2
>) ... exceptions.TypeError
divmod(<CoerceNumber 2>, <CoerceNumber 2>) = (1, 0)
Lib/test/test_coercion.py
Dosyayı görüntüle @
6cbba50a
...
...
@@ -67,11 +67,26 @@ class MethodNumber:
candidates
=
[
2
,
4.0
,
2L
,
2
+
0
j
,
[
1
],
(
2
,),
None
,
MethodNumber
(
1
),
CoerceNumber
(
2
)]
MethodNumber
(
2
),
CoerceNumber
(
2
)]
infix_binops
=
[
'+'
,
'-'
,
'*'
,
'/'
,
'**'
,
'
%
'
]
prefix_binops
=
[
'divmod'
]
def
format_float
(
value
):
if
abs
(
value
)
<
0.01
:
return
'0.0'
else
:
return
'
%.1
f'
%
value
# avoid testing platform fp quirks
def
format_result
(
value
):
if
isinstance
(
value
,
complex
):
return
'(
%
s +
%
sj)'
%
(
format_float
(
value
.
real
),
format_float
(
value
.
imag
))
elif
isinstance
(
value
,
float
):
return
format_float
(
value
)
return
str
(
value
)
def
do_infix_binops
():
for
a
in
candidates
:
for
b
in
candidates
:
...
...
@@ -83,7 +98,7 @@ def do_infix_binops():
error
=
sys
.
exc_info
()[:
2
]
print
'...
%
s'
%
error
[
0
]
else
:
print
'='
,
x
print
'='
,
format_result
(
x
)
try
:
z
=
copy
.
copy
(
a
)
except
copy
.
Error
:
...
...
@@ -95,7 +110,7 @@ def do_infix_binops():
error
=
sys
.
exc_info
()[:
2
]
print
'...
%
s'
%
error
[
0
]
else
:
print
'=>'
,
z
print
'=>'
,
format_result
(
z
)
def
do_prefix_binops
():
for
a
in
candidates
:
...
...
@@ -108,7 +123,7 @@ def do_prefix_binops():
error
=
sys
.
exc_info
()[:
2
]
print
'...
%
s'
%
error
[
0
]
else
:
print
'='
,
x
print
'='
,
format_result
(
x
)
warnings
.
filterwarnings
(
"ignore"
,
r'complex divmod\(\), // and
%
are deprecated'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment