Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
# test __complex__ function support
class TestFloat:
def __float__(self):
return 1.0
class TestComplex:
def __complex__(self):
return 1j + 10
class TestStrComplex:
return "a"
class TestNonComplex:
return 6
class Test:
pass
print(complex(TestFloat()))
print(complex(TestComplex()))
try:
print(complex(TestStrComplex()))
except TypeError:
print("TypeError")
print(complex(TestNonComplex()))
print(complex(Test()))