Skip to content

Commit 213a718

Browse files
committed
tests/float: Add test for assigning to attribute of complex number.
1 parent e873243 commit 213a718

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/float/complex1.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
# convert bignum to complex on rhs
5252
ans = 1j + (1 << 70); print("%.5g %.5g" % (ans.real, ans.imag))
5353

54+
# can't assign to attributes
55+
try:
56+
(1j).imag = 0
57+
except AttributeError:
58+
print('AttributeError')
59+
5460
# can't convert rhs to complex
5561
try:
5662
1j + []

0 commit comments

Comments
 (0)