diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-01-19 23:37:21 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-01-19 23:37:21 +1100 |
| commit | 213a7189537fc7b9cc96f0259e5b7b9e46121927 (patch) | |
| tree | 47cae076e38f2443c0e10139867bbeb3f56a1a7a /tests/float | |
| parent | e873243aa3487d21b3a7420eeacba73aefd6fcef (diff) | |
tests/float: Add test for assigning to attribute of complex number.
Diffstat (limited to 'tests/float')
| -rw-r--r-- | tests/float/complex1.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/float/complex1.py b/tests/float/complex1.py index 027d12583..fed65d5d5 100644 --- a/tests/float/complex1.py +++ b/tests/float/complex1.py @@ -51,6 +51,12 @@ print(float('-inf') * (1 + 1j)) # convert bignum to complex on rhs ans = 1j + (1 << 70); print("%.5g %.5g" % (ans.real, ans.imag)) +# can't assign to attributes +try: + (1j).imag = 0 +except AttributeError: + print('AttributeError') + # can't convert rhs to complex try: 1j + [] |
