mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Fix the superficial augmented-assignment tests to deal with true division.
Add (equally superficial) >>=/<<= test in the process. Relies on floats that should be extremely close to the int '6' printing as '6.0', but I believe that's a valid assumption ;P
This commit is contained in:
parent
8690c4ed3f
commit
34729030a7
2 changed files with 22 additions and 10 deletions
|
@ -5,42 +5,51 @@ x += 1
|
|||
x *= 2
|
||||
x **= 2
|
||||
x -= 8
|
||||
x /= 2
|
||||
x //= 1
|
||||
x %= 12
|
||||
x >>= 1
|
||||
x &= 2
|
||||
x |= 5
|
||||
x ^= 1
|
||||
x <<= 2
|
||||
x /= 2
|
||||
x //= 2
|
||||
|
||||
print x
|
||||
print int(x)
|
||||
|
||||
x = [2]
|
||||
x[0] += 1
|
||||
x[0] *= 2
|
||||
x[0] **= 2
|
||||
x[0] -= 8
|
||||
x[0] /= 2
|
||||
x[0] //= 2
|
||||
x[0] %= 12
|
||||
x[0] >>= 1
|
||||
x[0] &= 2
|
||||
x[0] |= 5
|
||||
x[0] ^= 1
|
||||
x[0] <<= 2
|
||||
x[0] /= 2
|
||||
x[0] //= 2
|
||||
|
||||
print x
|
||||
print int(x[0])
|
||||
|
||||
x = {0: 2}
|
||||
x[0] += 1
|
||||
x[0] *= 2
|
||||
x[0] **= 2
|
||||
x[0] -= 8
|
||||
x[0] /= 2
|
||||
x[0] //= 1
|
||||
x[0] %= 12
|
||||
x[0] >>= 1
|
||||
x[0] &= 2
|
||||
x[0] |= 5
|
||||
x[0] ^= 1
|
||||
x[0] <<= 2
|
||||
x[0] /= 2
|
||||
x[0] //= 2
|
||||
|
||||
print x[0]
|
||||
print int(x[0])
|
||||
|
||||
x = [1,2]
|
||||
x += [3,4]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue