diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2018-03-23 14:46:03 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-23 14:46:03 -0700 |
| commit | 8d376a3efb9229c56d4d90c57368d98f4957bf0b (patch) | |
| tree | b9e2f5f0110e020d26571dc5cd084d0268132465 /tests/basics | |
| parent | ce8f7e69bfa517cd81c1325b591808e49148a0f5 (diff) | |
| parent | cdb83b18ece63b13d6796e315f0737f833c1ee16 (diff) | |
Merge pull request #693 from jepler/issue236
Implement * and *= for array.array
Diffstat (limited to 'tests/basics')
| -rw-r--r-- | tests/basics/array_mul.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/basics/array_mul.py b/tests/basics/array_mul.py new file mode 100644 index 000000000..bb5f3aa6b --- /dev/null +++ b/tests/basics/array_mul.py @@ -0,0 +1,28 @@ +try: + import array +except ImportError: + print("SKIP") + raise SystemExit + +a1 = array.array('I', [1]) +a2 = array.array('I', [2]) * 2 +a3 = (a1 + a2) +print(a3) + +a3 *= 5 +print(a3) + +a3 *= 0 +print(a3) + +a4 = a2 * 0 +print(a4) + +a4 *= 0 +print(a4) + +a4 = a4 * 2 +print(a4) + +a4 *= 2 +print(a4) |
