summaryrefslogtreecommitdiff
path: root/Lib/test/test_augassign.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-03-24 08:14:36 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-03-24 08:14:36 +0000
commitbcc0db82dc9cb474d56a4cc63748583232d9524f (patch)
tree0107d20b29b61fc7dfd9626ee7257242f8cf6302 /Lib/test/test_augassign.py
parented483ba63b9c03845386976bccff5d95df5b570a (diff)
downloadcpython-git-bcc0db82dc9cb474d56a4cc63748583232d9524f.tar.gz
Get rid of remnants of integer division
Diffstat (limited to 'Lib/test/test_augassign.py')
-rw-r--r--Lib/test/test_augassign.py30
1 files changed, 9 insertions, 21 deletions
diff --git a/Lib/test/test_augassign.py b/Lib/test/test_augassign.py
index 8a8f00d88d..228e03a310 100644
--- a/Lib/test/test_augassign.py
+++ b/Lib/test/test_augassign.py
@@ -5,7 +5,7 @@ x += 1
x *= 2
x **= 2
x -= 8
-x //= 2
+x /= 2
x //= 1
x %= 12
x &= 2
@@ -19,7 +19,7 @@ x[0] += 1
x[0] *= 2
x[0] **= 2
x[0] -= 8
-x[0] //= 2
+x[0] /= 2
x[0] //= 2
x[0] %= 12
x[0] &= 2
@@ -33,7 +33,7 @@ x[0] += 1
x[0] *= 2
x[0] **= 2
x[0] -= 8
-x[0] //= 2
+x[0] /= 2
x[0] //= 1
x[0] %= 12
x[0] &= 2
@@ -123,14 +123,6 @@ class testall:
print "__imul__ called"
return self
- def __div__(self, val):
- print "__div__ called"
- def __rdiv__(self, val):
- print "__rdiv__ called"
- def __idiv__(self, val):
- print "__idiv__ called"
- return self
-
def __floordiv__(self, val):
print "__floordiv__ called"
return self
@@ -147,6 +139,9 @@ class testall:
def __itruediv__(self, val):
print "__itruediv__ called"
return self
+ def __rtruediv__(self, val):
+ print "__rtruediv__ called"
+ return self
def __mod__(self, val):
print "__mod__ called"
@@ -217,16 +212,9 @@ x * 1
1 * x
x *= 1
-if 1/2 == 0:
- x / 1
- 1 / x
- x /= 1
-else:
- # True division is in effect, so "/" doesn't map to __div__ etc;
- # but the canned expected-output file requires that those get called.
- x.__div__(1)
- x.__rdiv__(1)
- x.__idiv__(1)
+x / 1
+1 / x
+x /= 1
x // 1
1 // x