summaryrefslogtreecommitdiff
path: root/tests/float/complex_dunder.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/float/complex_dunder.py')
-rw-r--r--tests/float/complex_dunder.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/float/complex_dunder.py b/tests/float/complex_dunder.py
index 128dc6929..975d829b4 100644
--- a/tests/float/complex_dunder.py
+++ b/tests/float/complex_dunder.py
@@ -1,6 +1,11 @@
# test __complex__ function support
+class TestFloat:
+ def __float__(self):
+ return 1.0
+
+
class TestComplex:
def __complex__(self):
return 1j + 10
@@ -20,6 +25,7 @@ class Test:
pass
+print(complex(TestFloat()))
print(complex(TestComplex()))
try: