tests/float: Add test for assigning to attribute of complex number.
This commit is contained in:
parent
e873243aa3
commit
213a718953
|
@ -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 + []
|
||||
|
|
Loading…
Reference in New Issue